To provide a real running environment for the server, an UbuntuLinux server is deployed in the internal network today. The biggest headache is the installation of MySQL. apt is too slow to download updates, so I compiled the MySQL source code by myself. For details about the compilation method, refer to some information on the Internet. Here I will only briefly describe how to start the MySQL remote access function: (1) check whether MySQL 3306 is open to the outside world. By default, MySQL does not provide the external access function. The method is as follows: Java code
To provide a real running environment for the server, an Ubuntu Linux server is deployed in the internal network today. The biggest headache is the installation of MySQL. apt is too slow to download updates, so I compiled the MySQL source code by myself. For details about the compilation method, refer to some information on the Internet. Here I will only give a brief description of how to start the MySQL remote access function:
(1) Check whether MySQL 3306 is open to the outside world. By default, MySQL does not provide the external access function. The method is as follows:
Java code
~ # Netstat-an | grep 3306
Tcp 0 0 127.0.0.1: 3306 0.0.0.0: * LISTEN
It can be seen from the above that port 3306 of mysql only listens to local connections, which hinders access from the external IP address to the database. The modification method is actually very simple, enter the directory of the mysql configuration file (/etc/mysql/my. cnf), find the following content in the file:
Java code
# Instead of skip-networking the default is now to listen only on
# Localhost which is more compatible and is not less secure.
Bind-address = 127.0.0.1
Comment out bind-address or change it to the IP address of the client host you want to use.
In this way, even if the mysql remote access port is enabled, another more important step is to authorize the remote user.
(2) check whether the client user has access permissions.
To grant the user access permission to the mysql client, we can authorize the user as follows:
Java code
Mysql> grant all on *. * to user_name @ '%' identified by 'user _ password ';
The user permissions granted by the preceding command can access any database and table in mysql ).
After completing the above two steps, restart mysql to remotely log on to the mysql server. The Mysql restart command is as follows:
Java code
Sudo/etc/init. d/mysql restart
The above is just a simple introduction, and it cannot be used to cure all kinds of diseases. The specific situation needs to be determined based on your own operating environment. I hope it will help you.