mysql 5.7 Unable to start service did not report any errors

Previously, when a complete installation mysql5.7 program, because the program is too large, can be installed after the installation files in the cache directory (smaller) copy out, stay later use.

 1 mysql-5.7.17-win32.msi
 2 mysql-5.7.17-winx64.msi   主程序
 3 mysql-connector-c++-1.1.7-win32.msi
 4 mysql-connector-c++-1.1.7-winx64.msi
 5 mysql-connector-c-6.1.6-win32.msi
 6 mysql-connector-c-6.1.6-winx64.msi
 7 mysql-connector-java-gpl-5.1.40.msi
 8 mysql-connector-net-6.9.9.msi
 9 mysql-connector-odbc-5.3.6-win32.msi
10 mysql-connector-odbc-5.3.6-winx64.msi
11 mysql-connector-python-2.1.4-py2.7-win32.msi
12 mysql-connector-python-2.1.4-py2.7-winx64.msi
13 mysql-connector-python-2.1.4-py3.3-win32.msi
14 mysql-connector-python-2.1.4-py3.3-winx64.msi
15 mysql-connector-python-2.1.4-py3.4-win32.msi
16 mysql-connector-python-2.1.4-py3.4-winx64.msi
17 mysql-documents-5.7.17.msi
18 mysql-examples-5.7.17.msi
19 mysql-for-excel-1.3.6.msi
20 mysql-for-visualstudio-1.2.6.msi
21 mysql-notifier-1.1.7.msi
22 mysql-utilities-1.6.4-win32.msi
23 mysql-utilities-1.6.4-winx64.msi
24 mysql-workbench-community-6.3.8-win32.msi
25 mysql-workbench-community-6.3.8-winx64.msi  管理工具

Install the above-mentioned two documents

After installation, I find mysql not start, system services could not find mysql service, execute the following command in cmd encountered a problem

mysql not start the service did not report any errors 

Solution

1 can not themselves create a data folder. If so, please delete 

2 executed in the bin directory of mysql mysqld --initialize-insecure (not set the root password, is recommended) command, the first execution time of this command will wait a little longer some, and console did not return any results. You can see the root directory of mysql will be more of a data folder, inside a pile of documents.

3 Run mysqld -install to install the service
4 Run net start mysql command to start Mysql service

Login random password when needed, and then change the password using the following command

SET PASSWORD = PASSWORD('Abcd1234');

 After that, you can use a database management mysql-workbench

Look for the red part of the positive solution

1 in the Microsoft Windows [version 10.0 . 15063 ]
 2 (c) 2017 in the Microsoft Corporation. all rights reserved.
3  
4 C: \ Windows \ system32> cd C: \ Program Files \ MySQL \ MySQL Server 5.7 \ bin
 5  
6 C: \ Program Files \ MySQL \ MySQL Server 5.7 \ bin> mysqld -install
 7  . Service successfully Installed
 8  
9 C : \ Program Files \ MySQL \ MySQL Server 5.7 \ bin> NET start MySQL
 10  MySQL service is starting.
 11  MySQL service failed to start.
12  
13  services did not report any errors.
14 
15 Type HELPMSG NET 3534 to get more help.
16  
17  
18 C: \ Program Files \ MySQL \ MySQL Server 5.7 \ bin> NET HELPMSG 3534 
19  
20  services did not report any errors.
21  
22  
23 C: \ Program Files \ MySQL \ MySQL Server 5.7 \ bin> mysqld --initialize-in the insecure
 24-  
25 C: \ Program Files \ MySQL \ MySQL Server 5.7 \ bin> -hlocalhost-uroot-MySQL - the p-
 26  the Enter password:
 27 ERROR 2003 (HY000): of Can ' t Connect to MySQL Server ON ' localhost ' (10061)
28 
29 C:\Program Files\MySQL\MySQL Server 5.7\bin>net start mysql
30 MySQL 服务正在启动 .
31 MySQL 服务已经启动成功。
32 
33 
34 C:\Program Files\MySQL\MySQL Server 5.7\bin>mysql -hlocalhost -uroot -p
35 Enter password:
36 Welcome to the MySQL monitor.  Commands end with ; or \g.
37 Your MySQL connection id is 3
38 Server version: 5.7.17 MySQL Community Server (GPL)
39 
40 Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
41 
42 Oracle is a registered trademark of Oracle Corporation and/or its
43 affiliates. Other names may be trademarks of their respective
44 owners.
45 
46 Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
47 
48 mysql> SET PASSWORD = PASSWORD('Abcd1234');
49 Query OK, 0 rows affected, 1 warning (0.00 sec)
50 
51 mysql>
52 
53 
54  

 

Guess you like

Origin www.cnblogs.com/endv/p/11222988.html