How to solve mysql Service Startup failure during mysql5.7.18 installation, mysql5.7.18mysql
MySQL is a very powerful relational database. However, some beginners may encounter various difficulties when installing the configuration. Here we will not talk about the installation process, but about the configuration process. Mysql files downloaded from the official website are in the msi and zip formats. Run and install Msi directly, and unzip the zip file to your favorite directory address. You must configure these two methods before using them. The following describes the default address in msi format: C: \ Program Files \ mysql-5.7.18-win32.
1. After installation or decompression, You need to configure the environment variables as follows: My computer> Properties> advanced system Settings> advanced> environment variables. Click path in the system variable and select edit. Append C: \ ProgramFiles \ mysql-5.7.18-win32 \ bin. What you need here is not overwrite! In addition, it is best to append at the beginning. The English Semicolon ";" cannot be missed. (It can also be inserted in the middle, but remember to append it after .)
2. Click Start Menu, search for cmd.exe, and click left to run as administrator. Be sure to run as administrator !!!
If you run cmd directly, the following error occurs when you enter mysqld-install: Install/Remove of theService Denied!
When you enter mysqld-install correctly and press enter, The service already exists is displayed!
3. Enter net start mysql to start the server. If the server fails to be started, as shown in.
This is because in versions above 5.7, C: \ Program Files \ mysql-5.7 + directory does not have a data folder, here, remember not to copy other versions of mysql data folder, but in the window InputMysqld -- initialize-insecure -- user = mysql. Note that there is a space in front,Then press Enter. (Wait for half a minute to check the computer speed)
(In the C: \ ProgramFiles \ mysql-5.7.18-win32 directory, no data folder is displayed. For example)
Note: In versions earlier than 5.7, You need to modify the mysql-5 under the C: \ ProgramFiles \ my-default.ini. * directory, right-click Edit
Basedir = ......
Datadir = .....
Change
Basedir = C: \ Program Files \ mysql-5 .*
Datadir = C: \ Program Files \ mysql-5. * \ data
Where "C: \ Program Files \ mysql-5. *" is determined by the actual installation location
4. In the C: \ ProgramFiles \ mysql-5.7.18-win32 directory, the data folder is successfully created.
After the data is created, enter mysqld-install and press enter (if it is successfully started in step 3, you do not need to enter it again)
5. after the service is successfully started, you can log on. Enter mysql-u root-p and press Enter. Enter password is displayed. Because no logon password is set, you do not need to Enter anything. Press Enter.
Press enter. For example, the mysql configuration has been successful!
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.