1. Log in to mysql:
mysql -uroot -p123456
Or log in through the graphical client;
2. Authorize the root account:
grant all PRIVILEGES on test_db.* to root@'192.168.21.101' identified by '123456';
If it is accessible to all ips, replace the specific ip with %;
grant all PRIVILEGES on test_db.* to root@'%' identified by '123456';
123456 is the root password.
3. The last step, the most important step, must execute the following statement, otherwise it will not take effect immediately :
flush privileges;