Enable MySQL remote connection in Linux
How to enable MySQL remote connection in Linux.
By default, the root user of MySQL can only access MySQL locally and cannot remotely connect to and manage MySQL databases. How can I enable MySQL remote connection in Linux? The procedure is as follows:
1. GRANT command to create a remote connection mysql authorized user test
Mysql-u root-p
Mysql> grant all privileges on *. * TO test @ localhost identified by 'test' with grant option;
Mysql> grant all privileges on *. * TO test @ "%" identified by 'test' with grant option;
In the first sentence, the itlogger user is authorized to access through the Local Machine (localhost) and the password is 'test '. The second sentence is to authorize the test user to initiate access from any other host (wildcard % ).
2. Set the firewall to allow port 3306
Vi/etc/sysconfig/iptables
Add
-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 3306-j ACCEPT
(Note that before-A RH-Firewall-1-INPUT-j REJECT -- reject-with icmp-host-prohibited, otherwise the rule may not take effect)
Restart Firewall service iptables restart
-------------------------------------- Split line --------------------------------------
Install MySQL in Ubuntu 14.04
MySQL authoritative guide (original book version 2nd) Clear Chinese scan PDF
Ubuntu 14.04 LTS install LNMP Nginx \ PHP5 (PHP-FPM) \ MySQL
Build a MySQL Master/Slave server in Ubuntu 14.04
Build a highly available distributed MySQL cluster using Ubuntu 12.04 LTS
Install MySQL5.6 and Python-MySQLdb in the source code of Ubuntu 12.04
MySQL-5.5.38 universal binary Installation
-------------------------------------- Split line --------------------------------------
This article permanently updates the link address: