We know that in someMySQL databaseVersion in progress,Root UserBy defaultRemote LoginBut sometimes, when we want them to log on remotely, we often do this:
- Grant all on *. * to root @ '%' identified by 'yourpassword ';
In this way, the root user can log on remotely. However, the following method does not work.
- Grant all on *. * to root @ '% ';
Cause:
If no password is specified, this operation will only be performed in mysql. the user table matches the records of user = 'root' and host = '%'. If the records are found, modify the corresponding permission information. Otherwise, an error is returned.
If the password is specified, the user = 'root' and host = '%' records will also be matched in the mysql. user table. If the password cannot be found, add such records and perform authorization.
Therefore, the root user of the MySQL database must be very careful when logging on remotely and specify a password for it. Otherwise, errors may occur.
There are so many questions about the remote login of the root user of the MySQL database. I hope this introduction will bring you some benefits. Thank you for reading this article!