MySQL is installed using Apt-get.
1. Stop the MySQL service
sudo service MySQL stop
2. Modify the configuration file /etc/mysql/mysql.conf.d/mysqld.cnf
Change bind-address = 127.0.0.1 this line to bind-address = 0.0.0.1
3. Log in to MySQL using root
[Email protected]:~$ mysql-u root-pmysql> Grant All on * * to [email protected]"%" " remote login password "mysql> flush privileges;mysql> quit[email Protected]-vm:~$ sudo service mysql restart # restart MySQL Services
[email protected]% in% means all IPs have connection rights
But the remote login password can be different from the local login password
Set Password for local login
" password for local login "
Initial state
After the modified
Passwords for local logins and remote logins can be different
Lessons Learned: The root-related items in the Mysql.user table are best not to be deleted, I have no intention of deleting one, although I can still log in, but each time I execute the following statement fails
Ubuntu MySQL deny remote connection (10061)