MySQL root user does not see MySQL library problem solving method in Linux

Source: Internet
Author: User

The first way:

1. Stop MySQL Services first: Service mysqld stop
2. Add parameter start Mysql:/usr/bin/mysqld_safe--skip-grant-tables &
Then you can access MySQL without any restrictions.
3.root User Login system: Mysql-u root-p MySQL
4. Switch database: Use MySQL
5. Show All tables: show tables;
You can access the table here.
6. View the root user's localhost permissions in the Users table: SELECT * from user where user= ' root ' and host= ' localhost '
7. Shown in the list shown: The root user's localhost permissions are ' N ', indicating that the root user does not have permission to log on locally
8. Modify the root user's localhost permissions:
Update user Set
' Select_priv ' = ' Y ',
' Insert_priv ' = ' Y ',
' Update_priv ' = ' Y ',
' Delete_priv ' = ' Y ',
' Create_priv ' = ' Y ',
' Drop_priv ' = ' Y ',
' Reload_priv ' = ' Y ',
' Shutdown_priv ' = ' Y ',
' Process_priv ' = ' Y ',
' File_priv ' = ' Y ',
' Grant_priv ' = ' Y ',
' References_priv ' = ' Y ',
' Index_priv ' = ' Y ',
' Alter_priv ' = ' Y ',
' Show_db_priv ' = ' Y ',
' Super_priv ' = ' Y ',
' Create_tmp_table_priv ' = ' Y ',
' Lock_tables_priv ' = ' Y ',
' Execute_priv ' = ' Y ',
' Repl_slave_priv ' = ' Y ',
' Repl_client_priv ' = ' Y ',
' Create_view_priv ' = ' Y ',
' Show_view_priv ' = ' Y ',
' Create_routine_priv ' = ' Y ',
' Alter_routine_priv ' = ' Y ',
' Create_user_priv ' = ' Y ',
' Event_priv ' = ' Y ',
' Trigger_priv ' = ' Y ',
' Create_tablespace_priv ' = ' Y '
where user= ' root ' and host= ' localhost
9. Update: Flush privileges;
10. Then restart the MySQL to solve the problem

The first one does not take the second type of:

Delete the MySQL file in data:

Delete MySQL after execution: . /scripts/mysql_install_db--user=mysql --datadir=/usr/local/mysql/data/mysql

It should be good.

MySQL root user does not see MySQL library problem solving method in Linux

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.