How to set the remote access password for mysql: first log in to mysql, and query the user table and host authority commands; then delete the remote access user root, and update the authority commands; finally recreate the remote operation account for remote access authorization and update permissions.
Related free learning recommendation: mysql video tutorial
mysql method of setting remote access password :
1. Login to mysql command: mysql -uroot -p
(press enter to enter password)
2. Query user table and host Permission command:
use mysql select user, host from mysql.user;
Note: The % here means that any machine can remotely connect to the server through root, we can directly delete this user and redefine the user and password.
6. Re-create the remote operation account, authorize remote access and update permissions, and execute the following codes in sequence:
create user 'root'@'%' identified with mysql_native_password by '123456'; grant all privileges on *.* to & # 39; root & # 39; @ & # 39; % & # 39; with grant option; flush privileges;
The above is the detailed content of how to set the remote access password for mysql. For more information, please pay attention to other related articles on 1024programmer.com!