Connect to MySQL database in LAN

In general, the account of the MySQL host is not allowed to be accessed remotely, and can only be accessed through localhost. At this time, only the access authority needs to be released.

$ mysql -u root -p

mysql> use mysql;

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

mysql> flush privileges;
# Query OK, 0 rows affected(0.01sec) 即表示为成功

After restarting MySQL, you can access it according to the LAN IP.

Guess you like

Origin blog.csdn.net/yotcap/article/details/122706930