Introduction : 

MySQL is an open-source relational database management system (RDBMS) that enables efficient storage and retrieval of data. It uses a structured query language (SQL) to manage databases, providing a scalable solution for various applications. MySQL is known for its reliability, speed, and ease of use, making it a popular choice for web applications, content management systems, and other data-driven software.

Prerequisites: 

  • Hostname or IP address of the remote MySQL server.
  • Port number (default is 3306).
  • Username and password with appropriate privileges.

Method 1: Using Terminal

Step 1: Launch the MySQL client of the remote host.

Enter the following command to log in to the Mysql 

mysql -u [username] -p [password] -h [host] -P 3306

If not created any username and password in the local server you can simply enter the following command.

mysql

After you press Enter, the system will prompt you to MYSQL Access.

Step 3: Exit MySQL

To exit the MySQL command-line client, you can type:

EXIT;

This will take you back to the regular command prompt.

Method 2: Using Workbench

Step 1: Install and open the MySQL workbench. Click the + icon shown on the home page “MySQL Connections”

Step 2:
Connect Using Parameters

Connection Name – The connection name for our reference.
Connection Method – Choose the connection method as Standard TCP/IP over SSH.
SSH Hostname – Provide the remote system IP and Port. The port must be 22 unless it’s configured directly on the remote system.
SSH Username – The system username used to connect the remote server.
SSH Password OR SSH Key File – The System User Password or SSH Key File used to connect the remote system over SSH.
MySQL Hostname – Enter your MySQL Remote hostname/IP address
MySQL Server Port – It must be 3306 unless your remote server is configured to use a different port.
Username – The MySQL server username to open the connection.
Password – The MySQL server user password. You can either store in vault by clicking the Store in Vault Button.

Finally, establishing the MySQL connection is successful.

Connect using SSL mode:

  1. Connecting to MySQL with CA certificate verification
  2. If you would like to verify the server CA certificate, you will need the SSL CA certificate file.
  3. Go the the SSL tab as shown below and update the ‘use SSL’ and ‘SSL CA File’ fields as below

Disable the SSL requirement in MySQL Workbench :

  1. Choose Use SSL as “Require”
  2. Move to Advanced tab
  3. Enter “useSSL =0” in the Others option


Choose OK.
Finally, establishing the MySQL connection is successful.

Note :
Remove with
1.  “server_address” with the IP address or hostname of the remote server.
2. “username”  with your actual username.
3. “password” with your actual password.

Leave a Reply