按照我之前安裝5.6的安裝方法(MySQL免安裝版下載與配置)安裝5.7的時候出現問題: mysql服務無法啟動,服務沒有報任何錯誤 其實在這學期開始學習mysql的時候,就聽老師同學說,登錄不了的問題,當時沒有在意,也是因為電腦上早就安裝了mysql5.6,也就沒有在意這個問題。這兩天win10系 ...
按照我之前安裝5.6的安裝方法(MySQL免安裝版下載與配置)安裝5.7的時候出現問題:
mysql服務無法啟動,服務沒有報任何錯誤
其實在這學期開始學習mysql的時候,就聽老師同學說,登錄不了的問題,當時沒有在意,也是因為電腦上早就安裝了mysql5.6,也就沒有在意這個問題。這兩天win10系統出問題,重裝了win7,安裝5.7的時候出現了這個問題。
之前的版本預設密碼為空,具體版本不太清楚,反正5.6密碼是空。5.7的安全性提升,在linux安裝5.7的時候,安裝完成後會生成一個隨機性密碼,存儲在root/.mysql_secret中,如果沒有這個文件,去系統日誌中查找password,就應該能找到。
但是windows下就不知道如何解決了,不過最後還是找到瞭解決方法。
解決方法:
來自:windows MySql 5.7.9,啟動不了。缺少data
然而並不是缺少data文件夾,將my-default.ini文件改名為my.ini,移動到bin/目錄下,在bin/下執行命令 mysqld --initialize --user=mysql --console ,這條命令估計是初始化的命令
然後啟動服務 net start mysql
命令行顯示貼在這
Microsoft Windows [版本 6.1.7601]
版權所有 (c) 2009 Microsoft Corporation。保留所有權利。
C:\Windows\system32>cd ..
C:\Windows>cd ..
C:\>cd mysql-5.7.13-winx64/Boot
系統找不到指定的路徑。
C:\>cd mysql-5.7.13-winx64\bin
C:\mysql-5.7.13-winx64\bin>mysqld install
Service successfully installed.
C:\mysql-5.7.13-winx64\bin>net start mysql
MySQL 服務正在啟動 .
MySQL 服務無法啟動。
服務沒有報告任何錯誤。
請鍵入 NET HELPMSG 3534 以獲得更多的幫助。
C:\mysql-5.7.13-winx64\bin>net start mysql
MySQL 服務正在啟動 .
MySQL 服務無法啟動。
服務沒有報告任何錯誤。
請鍵入 NET HELPMSG 3534 以獲得更多的幫助。
C:\mysql-5.7.13-winx64\bin>mysqld --initialize --user=mysql --console
2016-06-21T14:07:20.922112Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is
deprecated. Please use --explicit_defaults_for_timestamp server option (see doc
umentation for more details).
2016-06-21T14:07:22.669315Z 0 [Warning] InnoDB: New log files created, LSN=45790
2016-06-21T14:07:23.106116Z 0 [Warning] InnoDB: Creating foreign key constraint
system tables.
2016-06-21T14:07:23.308916Z 0 [Warning] No existing UUID has been found, so we a
ssume that this is the first time that this server has been started. Generating
a new UUID: 79c8386d-37b9-11e6-9709-74867a6179b7.
2016-06-21T14:07:23.340116Z 0 [Warning] Gtid table is not ready to be used. Tabl
e 'mysql.gtid_executed' cannot be opened.
2016-06-21T14:07:23.355716Z 1 [Note] A temporary password is generated for root@
localhost: rr9.8h74twfR
C:\mysql-5.7.13-winx64\bin>mysql -uroot -prr9.8h74twfR
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)
C:\mysql-5.7.13-winx64\bin>net start mysql
MySQL 服務正在啟動 .
MySQL 服務已經啟動成功。
C:\mysql-5.7.13-winx64\bin>mysql -uroot -prr9.8h74twfR
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.13
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> set password=password('');
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> exit
Bye
C:\mysql-5.7.13-winx64\bin>mysql -uroot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.13 MySQL Community Server (GPL)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> exit
Bye
C:\mysql-5.7.13-winx64\bin>
View Code