Description about modifying the remote login of the root user in the MySQL database

Source: Internet
Author: User

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:

 
 
  1. 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.

 
 
  1. 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!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.