In the directory/etc/mysql find My.cnf, with Vim editor, find my.cnf inside
Bind-address = 127.0.0.1
to annotate it.
Then log in to the MySQL database with root.
Then enter mysql> here: Grant all on * * to [email protected] '% ' identified by ' password;
------------------------------------------------------------------------------------------------------------
Grant all privileges on * * to [email protected] '% ' identified by ' 111 ' with GRANT option;
Flush privileges;
The first line of the command is interpreted as follows, * *: The first * represents the database name, and the second * represents the table name. This means that all tables in the database are licensed to the user. Root: Grant root account. "%": indicates that the authorized user IP can be specified, which means that any IP address can access the MySQL database. "Password": Assign the password of the account, here the password itself is replaced with your MySQL root account password.
The second line of command is to refresh the permission information, that is, let our settings take effect immediately.
-------------------------------------------------------------------------------------------------------------
Note: username is a username, password is a name to fill out, for example:
Grant all on * * to root@ '% ' identified by '123456';
Then >exit; exit.
Finally, restarting MySQL will connect remotely.
ubuntu14.04 MySQL database allows remote access settings