1. 程式人生 > >mysql archive 8.0.11 windows安裝版 簡明過程

mysql archive 8.0.11 windows安裝版 簡明過程

參考 http://www.jb51.net/article/139219.htm


1.下載及壓解縮過程不做詳細說明。


2.在安裝目錄下(我的安裝目錄是在d:\Program Files\mysql) 新增 my.ini 檔案,如下是內容


[mysqld]
# 設定3306埠
port=3306
# 設定mysql的安裝目錄,自行確定
basedir=d:\Program Files\mysql
# 設定mysql資料庫的資料的存放目錄,自行確定
datadir=d:\mysql\Data
# 允許最大連線數
max_connections=200
# 允許連線失敗的次數。這是為了防止有人從該主機試圖攻擊資料庫系統
max_connect_errors=10
# 服務端使用的字符集預設為UTF8
character-set-server=utf8
# 建立新表時將使用的預設儲存引擎
default-storage-engine=INNODB
# 預設使用“mysql_native_password”外掛認證
default_authentication_plugin=mysql_native_password
[mysql]
# 設定mysql客戶端預設字符集
default-character-set=utf8
[client]
# 設定mysql客戶端連線服務端時預設使用的埠
port=3306

default-character-set=utf8

 

3.配置環境變數,若不配置則需要進入解壓縮的路徑去執行(如下)

D:\Program Files\mysql\bin>mysqld --initialize --console
2018-05-29T06:41:26.291500Z 0 [System] [MY-013169] [Server] D:\Program Files\mys
ql\bin\mysqld.exe (mysqld 8.0.11) initializing of server in progress as process
12196
2018-05-29T06:41:31.572802Z 5 [Note] [MY-010454] [Server] A temporary password i
s generated for

[email protected]: Xg0pLBMP&x#M   #這裡是系統產生的root初始密碼,後續登入時要用
2018-05-29T06:41:37.036115Z 0 [System] [MY-013170] [Server] D:\Program Files\mys
ql\bin\mysqld.exe (mysqld 8.0.11) initializing of server has completed

 

 

4.註冊mysql服務

 

 

 

D:\Program Files\mysql\bin>mysqld install mysql


Service successfully installed.

啟動服務
D:\Program Files\mysql\bin>net start mysql
mysql 服務正在啟動 .
mysql 服務已經啟動成功。

5.登入並修改密碼
D:\Program Files\mysql\bin>mysql -u root -p
Enter password: ************
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.11


Copyright (c) 2000, 2018, 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.
#修改root密碼 為 root (密碼自己定義)
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';