Mysql database permission issues, and solutions, mysql Permissions

Source: Internet
Author: User

Mysql database permission issues, and solutions, mysql Permissions

In the past, after directly installing mysql database and using the root user, you can log on to the command line or remotely perform operations. Since mysql was acquired by oracle, the permissions may be more detailed than before, installation environment Win 7x64, mysql version Server version: 5.5.32 MySQL Community Server (GPL), after installation, it is found that you can only log on from the local, but not through remote access, later, I searched for information on the Internet and found that I changed the root user's host in the mysql database to % and executed
Flush privileges;
After the execution, we found that we could log on remotely. However, when we log on locally using localhost or logging on with 127.0.0.1, we found that we could not log on again, query data mysql user permissions found that the root user has three linux systems, this can be ignored, the remaining two have different permissions for the same user name, and a password, another one without a password, tested

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 host = 'localhost' and user = 'root'


Update user set password = '* 81F5E21E35407D884A6CD4A731AEBFB6AF209E1B' where host = 'localhost' and user = 'root'

Flush privileges;
I found that I can log on with locahost. Now I have a deep understanding of mysql Data permissions.

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.