In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Xiaobian to share with you MacOSS through DMG file installation MySQL error after how to do, I believe most people do not know how to share this article for your reference, I hope you read this article after a great harvest, let us go to understand it!
MacOS installed MySQL via DMG file...
You may encounter these two headache tips:
error1Unable to connect to host 127.0.0.1 because access was denied.Double-check your username and password and ensure that access from your current location is permitted.MySQL said: Access denied for user 'root'@'localhost' (using password: YES)error2Unable to connect to host 127.0.0.1, or the request timed out.Be sure that the address is correct and that you have the necessary privileges, or try increasing the connection timeout (currently 10 seconds).MySQL said: Your password has expired. To log in you must change it using a client that supports expired passwords.
Not everyone will encounter this problem, but I do encounter it, there are many pits in it, solving these problems independently is also a check of your own basic knowledge, so I prefer to check independently first, if still not solved, then see the following. By the way, if you are in Laravel's officially recommended Homestead environment, you may not encounter these problems. But I am a more troubled person, especially like debug, especially like typing things in the command line, so I also solved this problem by the way, to share with you.
First, let's recreate the entire process starting with MySQL installation.
1. Download MySQL dmg installation package from mysql official website: dev.mysql.com/downloads/mysql/
2. After downloading the dmg file, double-click to install it. When you notice the last step, a prompt box will pop up:
W: ivGGB5lrdS after root@localhost This is the initial password given to you when MySQL is installed. This is very important and must be remembered.
Start MySQL:
Go to Mac System Preferences
After starting MySQL, I chose Sequel pro to operate the database.
At this point, the two previous errors will occur,
The error1 mentioned above means that your MySQL account password is wrong. I set the database-related configuration in the.env file of the laravel project at the beginning, so I directly enter the configuration in the.env file, and then I will prompt.
Unable to connect to host 127.0.0.1 because access was denied.Double-check your username and password and ensure that access from your current location is permitted.MySQL said: Access denied for user 'root'@'localhost' (using password: YES)
In addition to error2, the error prompt means:
password has expired, which means you can't log in with the initial password you just installed MySQL. You need to reset your MySQL password and log in to the root account with the new password. Next, we'll solve this problem.
Start by typing MySQL in command line mode
Barring any surprises, you'll see a prompt
mysql command not found
This is because we installed MySQL in the form of a dmg package. The system does not know MySQL. We need to add MySQL path to the bash file (my command line tool uses zsh, everyone uses it differently, but the idea is the same, that is, add MySQL path to the bash file)
Open the bash file first, then add the MySQL path.
Enter the following command in the open file, save and exit to use MySQL commands from the command line.
export PATH=$PATH:/usr/local/mysql/bin
After that, we need to reset the MySQL root account password by typing it on the command line
mysql -u root -p
Then enter the initial password provided by MySQL. If the following prompt appears, it means that we have entered MySQL's settings.
At this point, we type in mysql >
SET PASSWORD FOR 'root'@' localhost'= PASSWORD ('new password for root account you want to set');
when he saw
It means that the password reset is successful, and then we open Sequel pro and enter the root account and new password, you can use it.
The above is MacOSS through DMG file installation MySQL error how to do all the content, thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.