Mysql permission setting during the process of separating web and DB

Source: Internet
Author: User

[Document of the institute of fire station building school] the mysql permission problem encountered during the separation of web and DB.
Run
Use mysql;
Select user, password, host from user;
There is an account that can be logged on without the user name and password. So you just need to get rid of this
Update user set user = 'root', host = '192. 192.% 'where user = "and host = 'localhost ';

Modify user permissions
Grant all on * to root@192.168.0. %;
Flush privileges;
From the local connection test, there is still only the test table, and there is no permission to create a database. Run the following command to query
Show grants root@192.168.0. %;
The following results are found:
Grant usage on *. * TO 'root' @ '2017. 192. %'
The result is obviously incorrect.

Log out as another ROOT user and run the following command.
Show grants for current_user ();
The result is as follows:
Grant all privileges on *. * TO 'root' @ 'localhost' WITH GRANT OPTION

You didn't find it. You still need to add with grant option later. You are welcome to continue your communication at the School of building a website in the fire !~

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.