Let's start with the very basic: connecting to your MySQL server using SSH. When you connect using SSH, you need a client. One of the most recommended SSH client is Putty. This works for Windows. If you use Linux, Putty will run using the same set of SSH commands, but with a different installer (using its Linux version). It is very important that you make sure you have SSH enabled for your website hosting. If you do not, then you will never be able to communicate with your MySQL server in SSH. To connect to your MySQL server: Step 1: Launch Putty. Step 2: In the Putty Configuration, you will need to basically enter the following required information: Host Name: {hostname of your FTP server, NOT MySQL server} Port: {the port required to connect to SSH; some hosting companies may NOT use the default port 22, so you need to check with them}. Connection Type: SSH Example:
Step 3: Once all are set, click "Open." Step 4: You are then required to enter your SSH user name (this is still NOT your MySQL user name). You can get your SSH access from your web host. Step 5: Once you have entered your user name, Putty will ask you to enter your password, which you will need to type blindly. Step 6: Your connection with your hosting SSH server is successful if you do not see password warning errors, and you do see the SSH prompt (example): -bash-2.06b$ This prompt is different on other web hosting companies offering SSH, but it should end with $ sign. Step 7: In the prompt, you enter you MySQL login credentials. For example, if you have the following fictitious login: MySQL hostname: pdb3.alienwebhosting.com MySQL username: codexm MySQL password: interstellarguy You will enter it in the prompt as: -bash-2.06b$ mysql -hpdb3.alienwebhosting.com -ucodexm -pinterstellarguy The red bolded words in the syntax are the MySQL login details. The syntax for the MySQL command line login is: -bash-2.06b$ mysql -hHOSTNAME -uUSERNAME -pPASSWORD Step 8. If you see the MySQL command prompt after entering the login details in Step 7: mysql> Then you have successfully logged in and connected to your MySQL server using SSH.
blog comments powered by Disqus |
|
|
|
|
|
|
|