In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail the solutions to the failure of the mysql database. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
The solution to the failure to initialize the mysql database: first find and open the my.ini file; then comment out the datadir; in the my.ini file and finally change the UTF8 to UTF8MB4 as prompted.
Install MySQL8, failed to initialize database during installation
Approximate process
Download and unzip to the directory you want to install, for example, I am directly under disk C this time. C:\ mysql-8.0.17-winx64
Configure the environment variable and add C:\ mysql-8.0.17-winx64\ bin to the PATH environment variable to notice the ";" sign.
Create a new my.ini file in the C:\ mysql-8.0.17-winx64 directory.
It is easy to make mistakes when writing the contents of my.ini files.
Initialize the database. [I am stuck here] if the initialization is successful, there may be a default password for MySQL
Install the database
Start the login database [log in with the default password in 5 for the first time]
Modify the password
Find some tutorials on the Internet as a reference, there is a solution is to see in a comment, can not find the original blog, the solution, such as the following figure, is to comment out the datadir line.
The main problem encountered is that in the preparation of my.ini files, there may be errors in format and content. In the format, we should pay attention to try "\"\ "/" and whether to add double quotation marks in * * "C:\ mysql-8.0.17-winx64" * *. The following is my my.ini file, which is roughly the same as the reference blog, with some changes after I reported the error.
The error on the command line during database initialization is as follows:
C:\ mysql-8.0.17-winx64\ bin > mysqld-- initialize-- console2019-08-24T13:33:22.622321Z 0 [System] [MY-013169] [Server] C:\ mysql-8.0.17-winx64\ bin\ mysqld.exe (mysqld 8.0.17) initializing of server in progress as process 84042019-08-24T13:33:22.624188Z 0 [Warning] [MY-013243] [Server]-character-set-server: The character set UTF8MB3 is deprecated and will be removed in a future release. Please consider using UTF8MB4 instead.2019-08-24T13:33:22.625619Z 0 [ERROR] [MY-010457] [Server]-- initialize specified but the data directory has files in it. Aborting.2019-08-24T13:33:22.625635Z 0 [ERROR] [MY-013236] [Server] The designated data directory C:\ mysql-8.0.17-winx64\ data\ is unusable. You can remove all files that the server added to it.2019-08-24T13:33:22.643590Z 0 [ERROR] [MY-010119] [Server] Aborting2019-08-24T13:33:22.643744Z 0 [System] [MY-010910] [Server] C:\ mysql-8.0.17-winx64\ bin\ mysqld.exe: Shutdown complete (mysqld 8.0.17) MySQL Community Server-GPL.
The problem should be the data folder. At that time, there was no newly generated data folder in the C:\ mysql-8.0.17-winx64 directory. If you comment out the line datadir in the my.ini file, the error is gone, and the data folder also appears, as shown below:
Warring's solution is to change UTF8 to UTF8MB4 according to its prompts. All the changes are marked in the picture above.
2019-08-24T13:33:22.624188Z 0 [Warning] [MY-013243] [Server]-- character-set-server: The character set UTF8 is deprecated and will be removed in a future release. Please consider using UTF8MB4 instead.
Finally, initialization is successful, as shown in the figure:
General process
C:\ mysql-8.0.17-winx64\ bin > mysqld-- initialize-- console2019-08-24T13:37:11.590803Z 0 [System] [MY-013169] [Server] C:\ mysql-8.0.17-winx64\ bin\ mysqld.exe (mysqld 8.0.17) initializing of server in progress as process 24842019-08-24T13:37:15.862830Z 5 [Note] [Server] A temporary password is generated for root@localhost: 37swG%65Qjf12019-08-24T13: 37Server 17.783854Z 0 [System] [Server] C:\ mysql-8.0.17-winx64\ bin\ mysqld.exe (mysqld 8.0.17) initializing of server has completedC:\ mysql-8.0.17-winx64\ bin > mysqld-- installThe service already administrators the current server installed: C:\ mysql-8.0.17-winx64\ bin\ mysqld.exe MySQLC:\ mysql-8.0.17-winx64\ bin > net start mysqlMySQL service is starting. MySQL service has been started successfully. C:\ mysql-8.0.17-winx64\ bin > mysql- u root-pEnter password: * Welcome to the MySQL monitor. Commands end with; or\ g.Your MySQL connection id is 8Server version: 8.0.17Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.mysql > ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY' 111111 query OK, 0 rows affected mysql > about the failure of mysql database solutions are shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
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.