How To Connect Mysql Database

Table of contents:

How To Connect Mysql Database
How To Connect Mysql Database

Video: How To Connect Mysql Database

Video: How To Connect Mysql Database
Video: Connecting to a MySQL database with MySQL Workbench 6 2024, December
Anonim

MySQL operates with SQL, which is a structured query language and is a popular open source database management system. Remote connection allows you to connect to the desired database on the server from a desktop computer.

How to connect mysql database
How to connect mysql database

Necessary

putty

Instructions

Step 1

In order to perform a normal connection to the selected MySQL database, open the control panel and select the "MySQL databases" group. Specify the required base and type the IP address used to connect to the Internet in the Access Hosts group. Use the Add Host command and print the data:

- your domain name - in the "Server for connection" field;

- 3306 - in the line "Port for connection";

- your account name and password - in the "Username and password" field.

Thus, the command syntax looks like:

mysql -P 3306 -h domain_name.ru -u mylogin_user -p mylogin_db.

Step 2

Download from the official site and install on your computer a specialized application putty designed to securely connect to MySQL databases using an SSH tunnel. Run the installed application and open the Session menu in the left pane of the putty configuration window. Type your site's domain name in the Host Name line and expand the Connection node in the directory. Go to SSH and select the Tunnels section. Type 3306 on the Source Port line and localhost: 3306 on the Destination line. Confirm the execution of the selected action by clicking the Add button.

Step 3

Use the Open command to establish a connection with your host and log into the control panel with your account. Mount the desired database using the username and password you set when you created it. Specify 127.0.0.1 as the server IP and 3306 as the connection port. Thus, the command syntax looks like:

mysql -p 3306 -h 127.0.01 -u mylogin_user -p mylogin_db.

Please note that the presence of a running MySQL database server on the computer makes it impossible to use port 3306. In this case, specify a different port, for example, 3307.

Recommended: