In order to give the server a real operating environment, today in the intranet deployment of an Ubuntu Linux server, the most headache is the installation of MySQL, apt download update speed is too slow, so they compiled the source of MySQL itself, Specific compilation method can refer to some of the information on the Internet, here only to start MySQL remote access function to do a simple story:
(1) Confirm that 3306 is open to the public, MySQL default state is not open to external access function. See the following:
Java code
~# Netstat-an | grep 3306
TCP 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN
As can be seen from the above, the 3306 port of MySQL is only listening to local connections, which hinders the external IP access to the database, the method of modification is actually very simple, into the MySQL configuration file directory (/ETC/MYSQL/MY.CNF), find the following contents of the file:
Java code
# Instead of skip-networking The default is now-listen only on
# localhost which are more compatible and are not less secure.
Bind-address = 127.0.0.1
Comment out the bind-address or change it to the client host IP you want to use.
This way, if the remote access port of MySQL is turned on, there is a more important step to authorize the remote user.
(2) Confirm whether the client user has access rights.
In order to give access to the users of the MySQL client, we can authorize the user as follows:
Java code
Mysql> Grant All on * * to [e-mail protected] '% ' identified by ' User_password ';
The user rights granted by the above command can access any database and tables (table) in MySQL.
Complete the two steps above and restart MySQL to log on to the MySQL server remotely. The MySQL restart command is as follows:
Java code
Sudo/etc/init.d/mysql restart
Above is simply some introduction, can not package cure all diseases, the specific situation also need to according to their own operating environment to be determined, I hope to be helpful.
Open MySQL remote access feature in Ubuntu Linux