This article records remote access to the MySQL database set up under Ubuntu version 16.04.
First step: Modify the port bindings for the configuration file
The Open directory may be slightly different depending on the version of MySQL, you can first try to open/etc/mysql/my.cnf This configuration file, if the file does not exist or the file content is empty, try the following file path.
sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
Add # At the beginning of the line below, comment out the line, and then save to exit Vim:
bind-address = 127.0.0.1
Step Two: Modify access permissions
Go to MySQL, enter the following command, enter the password and enter the MySQL command line
mysql -u root -p
Grant root access and refresh permissions, where root can be replaced by other MySQL users, and the PWD section should be replaced with the password for that user
grant all privileges on *.* to [email protected]"%" identified by "pwd" with grant option;flush privileges;exit;
Step three: Restart the MySQL service
service mysql restart
感谢博主分享
原文:http://www.cnblogs.com/zhangkaiqiang/p/6646488.html
Ubuntu 16.04 set MySQL remote access permissions