Mysql> SELECT * FROM WHERE name != "Bob" AND phone_number = '3444444' order by phone_number Show all records not containing the name “Bob” AND the phone number ‘3444444’ order by the phone_number field Mysql> SELECT * FROM WHERE name = "Bob" AND phone_number = '3444444' Show all records containing the name “Bob” AND the phone number ‘3444444’ Show certain selected rows with the value “whatever” Show the columns and column information pertaining to the designated table To see all the tables in the selected database It would print out the mysql directory, and then you can use the above command as this: # /bin/mysql -h hostname -u root -p If you get an error with the above command then type # which mysql to make sure that mysql is installed properly and to find the directory. This would ask you for a password and after providing the correct password you’d be logged-in to the MySQL prompt. To login (from unix shell) use -h hostname only if needed And when you see mysql> it means from a MySQL prompt after logging into MySQL. ![]() Start by logging-in using a SSH client, like PuTTY, to access the shell command line.īelow when you see # it means from the unix shell. Edit the kyo on mysql to be - and the ssh tunneling will work.Using MySQL from SSH may seem to be quite tricky if you’ve never done it before – but fear not – below is a list of MySQL commands that you can use to perform the required actions. You are connecting to the SSH server on your VM - and then connecting over localhost to the MySQL server. You need to change the "kyo" username to allow localhost connection (not that IP) since you are not connecting directly from your machine (24.62.137.111) to the MySQL server.The VM itself has its own set of rules (for allowing incoming connection). ![]() MySQL server is already "open" on port 3306 but as per your mysql db - it will only accept connection from some accounts and ).Leave it behind the VM and access it locally (over SSH tunnel). Unless absolutely necessary - I wouldn't make the MySQL instance public. What do I need to be able to connect to my MySQL remotely from my local machine ? As above - SSH tunnel to your MySQL instance.Do I need to create another kyo user in MySQL ? If you prefer.user kyo on the VM is a separate user to kyo in the MySQL - and it can have different password as well. Is the user in the he VM is different than the user in MySQL ? Yes. ![]() In the SSH tab - you enter your SSH credentials (how you SSH into the VM). The Host is localhost (because you are connecting locally). ![]() If you want to create a separate username / password for MySQL - you can do that too. Whatever connection you had there - you can use the Root Username/Password. Navicat seems to have option to create SSH tunnel for MySQL connection. Is that mean my port 3306 is not open to the public ? and I should for remote access ? correct ? I see this now mysql> select User,Host from er Ģ013 - Lost connection to MySQL server at 'reading initial communication packet', system error: 0 "Internal error/check (Not system error)" What do I need to be able to connect to my MySQL remotely from my local machine ? Is the user in the he VM is different than the user in MySQL ?ĭo I need to create another kyo user in MySQL ? I have these users in MySQL database mysql> select User,Host from er
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |