mysql安裝2020-04-13

菜鳥驛站教程
Q1:編碼格式不準確,模棱兩可

I:\Save\Dairy\Mysql\mysql-8.0.19-winx64\bin>mysqld --initialize --console
2020-04-13T12:12:18.030891Z 0 [System] [MY-013169] [Server] I:\Save\Dairy\Mysql\mysql-8.0.19-winx64\bin\mysqld.exe (mysqld 8.0.19) initializing of server in progress as process 7832
2020-04-13T12:12:18.375544Z 0 [Warning] [MY-013242] [Server] --character-set-server: 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
2020-04-13T12:12:48.254461Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: W>ul(l>Xd7gk

配置文件my.ini改爲

[client]
# 設置mysql客戶端默認字符集
default-character-set=UTF8MB4
 
[mysqld]
# 設置3306端口
port = 33306
# 設置mysql的安裝目錄
basedir=I:\\Save\\Dairy\\Mysql\\mysql-8.0.19-winx64
# 設置 mysql數據庫的數據的存放目錄,MySQL 8+ 不需要以下配置,系統自己生成即可,否則有可能報錯
# datadir=C:\\web\\sqldata
# 允許最大連接數
max_connections=20
# 服務端使用的字符集默認爲8比特編碼的latin1字符集
character-set-server=UTF8MB4
# 創建新表時將使用的默認存儲引擎
default-storage-engine=INNODB

此時MySQL是初始化成功了的,只是默認編碼有點問題,所以如果修改了配置文件重新初始化,則會出現錯誤

 The designated data directory I:\Save\Dairy\Mysql\mysql-8.0.19-winx64\data\ is unusable. You can remove all files that the server added to it.

將data文件下的所有數據都刪除即可。

Q2:輸入錯誤

mysql install
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

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