1. Open remote access on the server side
First enter the MySQL database and enter the following two commands:
Grant all privileges on * * to ' root ' @ '% ' identified by ' password ';
Flush privileges;
The first * is the database and can be changed to the name of the database allowed to access
The second is the table name of the database, which represents allowing access to arbitrary tables
Root represents the user name used for Telnet and can be customized
% means allow any IP login, if you want to specify a specific IP, you can replace the%
Password represents the password used when remote login, can be customized
Flush privileges; This is to get permission to take effect immediately
2. Modify the MY.CNF configuration file
This is the MySQL configuration file, if you do not find the title of the article where you can enter find/*-name MY.CNF found
Through vim to edit the file, find bind-address = 127.0.0.1 This sentence, and then add a # in front of the comment out, save exit
3. Restart Service
Service MySQL Restart
4, Local Remote connection
In Terminal input:
Mysql-h server IP address-p 3306-u root-p
then enter the password.
Root is the user name of the 1th setting, and the password is the 1th setting.
Install 3 Packages (+2 Dependent Packages)
Total Download size:171 M
Downloading packages:
mysql-community-server-5.7.10-1.el7.x86_64.rpm | 142 MB 00:03:42
mysql-community-libs-compat-5.7.10-1.el7.x86_64.rpm | 2.0 MB 00:00:03
mysql-community-libs-5.7.10-1.el7.x86_64.rpm | 2.2 MB 00:00:05
mysql-community-client-5.7.10-1.el7.x86_64.rpm | MB 00:00:41
Warning:/var/cache/yum/x86_64/7/mysql57-community/packages/mysql-community-common-5.7.10-1.el7.x86_64.rpm: Header V3 dsa/sha1 Signature, key ID 5072e1f5:nokey00 ETA
Public key for mysql-community-common-5.7.10-1.el7.x86_64.rpm are not installed
mysql-community-common-5.7.10-1.el7.x86_64.rpm | 269 KB 00:00:01
Retrieving Key from File:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Importing GPG key 0X5072E1F5:
Userid: "MySQL Release Engineering <[email protected]>"
Fingerprint:a4a9 4068 76fc bd3c 4567 70c8 8c71 8d3b 5072 e1f5
Package:mysql57-community-release-el7-7.noarch (@/mysql57-community-release-el7-7.noarch)
From:/etc/pki/rpm-gpg/rpm-gpg-key-mysql
Running transaction Check
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing:mysql-community-common-5.7.10-1.el7.x86_64 1/6
Installing:mysql-community-libs-5.7.10-1.el7.x86_64 2/6
Installing:mysql-community-client-5.7.10-1.el7.x86_64 3/6
Installing:mysql-community-server-5.7.10-1.el7.x86_64 4/6
Installing:mysql-community-libs-compat-5.7.10-1.el7.x86_64 5/6
Erasing:1:mariadb-libs-5.5.44-2.el7.centos.x86_64 6/6
Verifying:mysql-community-server-5.7.10-1.el7.x86_64 1/6
Verifying:mysql-community-libs-compat-5.7.10-1.el7.x86_64 2/6
Verifying:mysql-community-common-5.7.10-1.el7.x86_64 3/6
Verifying:mysql-community-libs-5.7.10-1.el7.x86_64 4/6
Verifying:mysql-community-client-5.7.10-1.el7.x86_64 5/6
Verifying:1:mariadb-libs-5.5.44-2.el7.centos.x86_64 6/6
Installed:
mysql-community-libs.x86_64 0:5.7.10-1.el7 mysql-community-libs-compat.x86_64 0:5.7.10-1.el7 Mysql-community-server.x86_64 0:5.7.10-1.EL7
Dependency installed:
mysql-community-client.x86_64 0:5.7.10-1.el7 mysql-community-common.x86_64 0:5.7.10-1.el7
Replaced:
Mariadb-libs.x86_64 1:5.5.44-2.el7.centos
complete!
[Email protected] ~]# Clear
A tutorial on how to implement remote connection MySQL database under Linux system