Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to set the user password of mysql in mac

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

Today, I will talk to you about how to set the user password for mysql in mac. Many people may not know much about it. In order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.

Use navicat to connect to mysql, log in successfully using root, and log in without password for root

After logging in successfully, navicat's function of managing users can add passwords to users, such as changing the password of user root@%, and can be saved successfully.

After logging in with navicat again, it is found that a password is required. If the password is correct, you can log in successfully.

Use the user management function of navicat to create a user, enter the user name, password, Host, set permissions, save, and then log in with navicat to the newly created user, prompting 1045-Access denied for user 'xx'@'xx' (using password: YES). Even if the password is entered successfully, you can not log in, but you can log in without entering the password.

Navicat cannot log in no matter what means it uses to change the newly created password, including directly modifying the mysql > user table, navicat logging in to the root user, and then executing SET PASSWORD FOR 'nickel'@'localhost' = PASSWORD (' 123456'). All of these means are unable to log in with a password. The use of these means to change the password will not report an error, and all of them will be executed successfully.

Use the command line way, use more ideas on the network:

# cd / usr/local/mysql/bin/#. / mysqld_safe-- skip-grant-tables#. / mysqlmysql > FLUSH PRIVILEGESmysql > SET PASSWORD FOR 'nickel'@'localhost' = PASSWORD (' 123456')

An error will be reported during the sequential execution, and after logging in to mysql successfully, you will find that the user logged in here is @ localhost, that is, the user whose User is empty in the mysql > user table will log in and will throw no permission error when executing the mysql command.

The final solution is to shut down the mysql service first, then start mysql through the command line, execute "mysqld_safe-- skip-grant-tables" to start mysql automatically, and then follow the above actions.

The conclusion is that if you want to use the command line of mysql to modify some settings of the database, start the mysql database through the command line

After reading the above, do you have any further understanding of how to set the user password for mysql in mac? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report