首先官網下載好mysql-8.0.15-winx64,并且解壓

1.剛解壓是沒有my.ini組態檔的,需要自己創建一個檔案,改后綴。
2.此處提供內容(注意復制粘貼去掉多余的文字內容):
[mysql]
# 設定mysql客戶端默認字符集
default-character-set=utf8
[mysqld]
#設定3306埠
port = 3306
# 設定mysql的安裝目錄,根據你安裝的來寫
basedir=D:\mysql-8.0.15-winx64
# 設定mysql資料庫的資料的存放目錄,我是手動創建了D:\MYSQL\mysql-8.0.15-winx64這兩個目錄,data初始化時會自動創建
datadir=D:\MYSQL\mysql-8.0.15-winx64\data
# 允許最大連接數
max_connections=200
# 服務端使用的字符集默認為8位元編碼的latin1字符集
character-set-server=utf8
# 創建新表時將使用的默認存盤引擎
default-storage-engine=INNODB
3.然后配置系統環境變數,我是直接把mysql的bin目錄的全路徑名添加到path里

4.正式開始安裝!以管理員身份打開cmd,輸入
mysqll -install
顯示Service successfully installed.
安裝成功!
5.此時要開啟資料庫服務
滑鼠右鍵我的電腦,管理,服務,找到mysql服務,右鍵啟動
6.輸入mysql --initialize --console,初始化資料庫,如果出現彈窗缺少什么東西的話,就是缺少c++2015運行環境,網上搜索下載就好了
顯示 [System] [MY-013169] [Server] D:\mysql-8.0.15-winx64\bin\mysqld.exe (mysqld 8.0.15) initializing of server in progress as process 6376
2019-10-14T07:25:13.769174Z 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.
2019-10-14T07:25:35.412167Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: Lu.lJLo8Jgef
2019-10-14T07:25:42.894103Z 0 [System] [MY-013170] [Server] D:\mysql-8.0.15-winx64\bin\mysqld.exe (mysqld 8.0.15) initializing of server has completed
注意A temporary password is generated for root@localhost:后面的就是初始化后的資料庫密碼,空格不算,注意大小寫
7.然后登陸mysql -u root -p
密碼:剛剛說的
8.登陸成功后要必須要初始化密碼:alter user'root'@'localhost' identfied with mysql_native_ password by '輸入你的新密碼';
Query OK, 0 rows affected (1.90 sec)修改成功!
9.安裝成功!!!
uj5u.com熱心網友回復:
昨天剛安裝的mysql-8.0.17-winx64,沒有my.inihttps://blog.csdn.net/sinat_28984567/article/details/102535923
uj5u.com熱心網友回復:
對,版本新的是可以不用配置了。多此一舉了哈哈
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/130286.html
標籤:基礎類
上一篇:小白求助!
下一篇:第三章思維導圖堆疊和佇列
