How to connect to MySQL via SSH

How to connect to MySQL via SSH

Any hosting that has SSH access enabled can connect to MySQL via console. 
 
 
To do so, you must use the following command:
 
mysql -h ipweb -u databaseuser -p
 
-h: In this option, enter the web IP of the hosting. You can check the IP in the Server Information section of the cdmon Control Panel.
-u: In this option, enter the MySQL user. You can check these details in the MySQL section of the cdmon Control Panel.
-p: In this option, enter the MySQL password. You can check these details in the MySQL section of the cdmon Control Panel.
 
An example of using this command is the following:
 
servv739 [Thu Jun 27 11:05]# mysql -h 212.36.77.20 -u myuser894 -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 160793
Server version: 5.0.51a-24+lenny1-log (Debian)
 
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
 
For more information, you can contact us.
    • Related Articles

    • Basic SSH Manual

      Buy Web Domain and SSL Certificates With SSH access, you can work with your files and directories securely, connecting from an application or command-line interpreter. Below we provide an example of a command-line interpreter for each of the most ...
    • How to import a database by SSH

      Before starting, it is important to mention that not all hosting plans provide SSH access. To follow this guide, you will need a plan that includes this feature. The available plans are the Senior plans or higher. You can check our comparison table ...
    • How to connect via FTP via webFTP

      To upload your website to your hosting account at cdmon, you need an FTP client. In the cdmon Control Panel, you have an intuitive web manager that allows you to perform the most common operations. The "WebFTP" service features allow you to access ...
    • Add SSH public key

      SSH keys are a secure and efficient way to authenticate on remote servers without having to enter a password each time you connect. If you need to generate an SSH key, especially on Windows, we recommend using PuTTY, a tool that allows you to easily ...
    • How to activate SSH access

      In versions higher than PHP 7.3, instead of the SSH/SFTP button, another button called "Developer hosting" will be available, through which these two options, as well as Git, can be activated. To do so, you must follow the instructions in the ...