After MySQL is installed, only the following hosts are recognized: localhost and 127.0.0.1.
The only hosts recognized after MySQL is installed are localhost and 127.0.0.1. If you want to allow the IP address on your machine to log on normally, there are two methods:
First, authorize your IP address 172.16.1.10
Grant privileges on dbname. * to "user" @ "172.16.1.10" identified by "password ";
If you only use it, you can write it like this.
Grant all on *. * to "user" @ "172.16.1.10" identified by "password ";
For more information about grant, see the mysql user manual.
Mysql> use mysql;
Database changed
Mysql> desc user; check the number of fields
Mysql> insert into user values (val1, val2 ,....);
The second is to set the root user to be able to log on remotely, that is, to log on from any machine.
Mysql> use mysql;
Database changed
Mysql> update user set host = "%" where user = "root ";
Mysql> use mysql
Grant all on *. * to "root" @ "172.30.41.72" identified by "x0000304 ";
Restart mysql server
Method 3: run the following command directly in the mysql database management background:
Use mysql;
Grant all on *. * to "root" @ "172.30.41.95" identified by "x0000304 ";
-------------------------------------- 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
-------------------------------------- Split line --------------------------------------
This article permanently updates the link address: