#記mysql workbench CE6.3的莫名崩潰#

目錄

 

前言

解決方案


前言

話說某天,突然筆記本上的mysql workbench CE6.3不知道是否升級失敗還是什麼原因,反正在workbench上所有的庫與schema都丟失,然後那個時候在使用sonarqube和搭建ansible,一攤事情沒搞定又蹦出另一攤。

 

解決方案

1、首先在windows搜索到原本的數據庫配置文件my.ini。

C:\ProgramData\MySQL\MySQL Server 5.7\my.ini

2、然後以管理員身份在MySQL安裝目錄的 bin 目錄下執行命令:

mysqld --initialize --console

執行完成後,會打印 root 的臨時初始默認密碼(如下圖)

2019-04-02T15:01:41.317617Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2019-04-02T15:01:43.622121Z 0 [Warning] InnoDB: New log files created, LSN=45790
2019-04-02T15:01:44.181330Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2019-04-02T15:01:44.383691Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 3ad2952f-5558-11e9-a8e3-005056c00001.
2019-04-02T15:01:44.449846Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2019-04-02T15:01:44.463592Z 1 [Note] A temporary password is generated for root@localhost: XXXXXXXXXXXXX

3、安裝服務

在MySQL安裝目錄的 bin 目錄下執行以下命令並得出以下安裝成功的結果。

mysqld --install [服務名] --defaults-file="[ini文件絕對路徑]" 
(如mysqld --install orginalMysql --defaults-file="C:\ProgramData\MySQL\MySQL Server 5.7\my.ini"
Service successfully installed.

4、運行服務

繼續在bin目錄下,運行以下命令並得出以下服務成功啓動的結果。

net start [服務名]
如 net start originalMysql
originalMysql 服務正在啓動 ..
originalMysql 服務已經啓動成功。

5、登錄成功 

C:\Program Files\MySQL\MySQL Server 5.7\bin>mysql -u root -p
Enter password: **********
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.14-log 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>
mysql>
mysql>
mysql>
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| application        |
| gun                |
| mysql              |
| performance_schema |
| sakila             |
| sonar              |
| sys                |
| world              |
| xwiki              |
+--------------------+
10 rows in set (0.10 sec)

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章