1: Remote database (D1) Data: Database User: Root, Database password: root, database IP intranet address 192.168.100.91, database port 3306
localhost: IP 192.168.127.1
Mode one: Use the Navicat client connection.
2: First on the remote database D1 to be able to access the IP authorization, can be through the remote host Navicat "User add users, you can also use the command line to add
2.1 Use Navicat user to add access to database IP address and username password, etc.
2.2 Adding an authorized user by using the command line
For example: you want to myuser use MyPassword (password) from any host to connect to the MySQL server.
Mysql>grant all privileges on * * to 'myuser' @'%' identified by 'MyPassword' with GRANT OPTI On; % represents all IPs.
If you want to allow users to connect to the MySQL server from a host myuser IP 192.168.1.6 and use MyPassword as the password
Mysql>grant all privileges on * * to ' myuser ' @ ' 192.168.1.3 ' identified by
' MyPassword ' with GRANT OPTION;
Mysql>FLUSH Privileges
Make the changes effective, you can.
Use:mysql> select Host,user from Mysql.user; command to see if the changes take effect.
3: The remote database enters the MySQL directory and modifies the address bindings in the MY.CNF bind-address
Cd/etc/mysql >vi my.cnf Change 127.0.0.1 (equivalent to localhost) to 0.0.0.0 (LOCALHOST+IP); the difference between the two: Https://www.cnblogs.com/bugutia N/p/5103618.html
Bind-address =0.0.0.0
This allows the remote machine to connect to the database via an IP address.
4: Restart the database, and the computer to make the configuration effective
5: Connection test via NAVICAT client:
6: Connection effect:
8: You can also connect using the command line.
C:/>mysql-h 192.168.100.91-p 3306-u Root-proot
Remotely connect to a MySQL database using a client, etc.