In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
These days, because of the work demand, we need to invite the MySQL out, so the dusty MySQL will be started. But things went against my wishes. Maybe I hadn't visited MySQL for a long time. MySQL ignored me angrily and threw out bursts of error reports.
1. One of them is: Windows cannot start the MySQL57 service (located on the local computer) error 1067: the process terminates unexpectedly, as shown in the following figure.
2. This is followed by an error: the MySQL service on the local computer starts and stops. Some services will automatically stop when they are not used by other services or programs, as shown in the following figure.
3. After that, even though I was dying and kept restarting the MySQL service in the command line window, I still didn't hit the pain point. The steps to try are illustrated below.
4, then take it for granted to enter the MySQL, it is impossible, can only hit the south wall, frustrated.
5. Later, I also thought of starting MySQL directly by clicking "my computer > Administration > Services > MySQL", but it didn't change at all.
6. After a try, it still doesn't work. In desperation, I kept looking for blog, and finally found a feasible way, but the cost is also very great, basically for MySQL to change. If friends have important data in their original MySQL, it is not recommended to use this method; if you feel that the data already in the database is irrelevant or accidentally encounter this problem, you can boldly use this method, but start all over again, and the specific steps are as follows.
First of all, be sure to use administrator privileges to enter the command line, be sure to use administrator privileges to enter the command line, be sure to use administrator privileges to enter the command line, say important things three times, otherwise there will be a "system error 5. Access denied." Such an error is shown in the following figure.
7. After that, go to the MySQL installation directory and find the bin directory. This process is necessary. The process is simple, combining the cd command with the dir command to view the directory file all the way until you go to the bin directory. Generally speaking, the default path for installing MySQL is: C:\ Program Files\ MySQL\ MySQL Server 5.7\ bin, which you can refer to.
8. Initialize the data directory afterwards. If there is no data folder under the folder at the same level as the bin directory, create an empty data directory with the name data. If you have this directory, remember to empty all the initial files in the data directory.
9. Then execute the command under the bin directory (open the command line window as an administrator): mysqld-initialize, as shown in the following figure. Initialization takes about 20 seconds, just wait and see.
You can then see that the MySQL service starts smoothly.
And a prompt will pop up in the MySQL Notifier on the status bar, as shown in the following figure, the state of MySQL changes from stop to start.
10. At this time, log in to the database again through the command window (command: mysql-u root-p) and you can enter it smoothly, but entering your password left over from history does not work well, and it will report an error as follows: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES), as shown in the following figure.
This is because after MySQL initialization, an initial password is generated and placed under the folder under the data folder with the suffix .err, as shown in the following figure.
11, at this time, through the computer's own notepad to open the file, is not very feasible, through the sublime text can be successfully opened, to "password" as the search term, quickly locate the initial password, as shown in the following figure.
This password is randomly generated and relatively complex and can be pasted directly into the command line window.
12. Copy the initialization password and paste it into the MySQL login password, as shown in the following figure.
At this point, you can see that you have successfully entered the MySQL.
13. However, after entering the simple command of MySQL directly, you will find that you cannot operate the database and will prompt for an error: ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement., as shown in the following figure.
14, this error means to tell you to reset the password, at this time only need to enter the command to reset the password. As for MySQL reset password there are many methods on the Internet, not described here, the syntax used by the editor is: alter user 'root'@'localhost' identified by' 123456 password, of which 123456 is the reset password, we can customize, after the smooth setting is completed, remember to refresh permissions: flush privileges;, then you can operate the database normally. The specific operation process of this step is shown in the following figure.
At this point, the problem has been solved perfectly. I hope it will be helpful to the friends who accidentally step into this pit in the future.
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.