As we all know,MySQL databaseMySQL Database Server is a widely used database system.Remote connectionIs an upgrade of the MySQL database server.
After the MySQL database server is installed on CentOS, the system does not allow you to connect to the database server through a non-local machine by default for security reasons, if you want to connect to the database server from another machine, you must manually modify it:
1. Run mysql-u root-p mysql on the console. The system prompts you to enter the password of the root user of the database. After the password is entered, the mysql console is displayed. The first mysql command of this command is to execute the command, the second mysql is the system data name, which is different.
2. ON the mysql console, run grant all privileges on *. * TO 'root' @ '%' identified by 'mypassword' with grant option;
3. Run The 'root' @ '%' command on the mysql console to understand that "root" is the user name and "%" is the host name or IP address. "%" here represents any host or IP address, you can also replace it with any other user name or specify a unique IP address. 'mypassword' is the password for authorized users to log on to the database; in addition, it should be noted that I here are to authorize all permissions, you can specify part of the permissions, GRANT specific operation details see: http://dev.mysql.com/doc/refman/5.1/en/grant.html
4. If you are not at ease, You can execute select host and user from user on the mysql console. Check the content in the user table, as shown in my check:
The implementation of the remote connection of the MySQL database can be completed as described in the previous article. The remote connection of the MySQL database can be achieved, and the connection between various computers is good, so that you can easily communicate with each other.