Remotely connect to mysql database

Sometimes we want to connect mysql on our computer on other computers, what should we do at this time?

mysql>use mysql;

mysql>select host,user,password from user;

View to localhost root hgfhahgahghahhahgjhgh

Need to modify localhost to "%", use update sql statement

mysql>update user set host='%' where user='root';

mysql>select host,user,password from user;

View to % root hgfhahgahghahhahgjhgh

refresh operation

mysql>flush privileges;

At this point, you can connect to your database remotely



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325573523&siteId=291194637