mysql add users authorized to connect multiple hosts

Create a user

create user zhangsan identified by 'zhangsan';

Authorize

grant all privileges on *.* to zhangsan@'%' identified by 'zhangsan';

flush privileges;

 

After mysql authorization is successful, the connection is not always on the look

 netstat -apn | grep 3306

tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN 

Modify the configuration file, comment out this line, restart

bind-address = 127.0.0.1

 

Source: https://www.cnblogs.com/pejsidney/p/8945934.html

Guess you like

Origin www.cnblogs.com/shaoyang0123/p/11242458.html