国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數據庫 > MySQL > 正文

Win10下怎樣安裝配置mysql 8.0.20

2024-07-24 12:36:12
字體:
來源:轉載
供稿:網友
  小編這次要給大家分享的是Win10下怎么安裝配置mysql 8.0.20,文章內容豐富,感興趣的小伙伴可以來了解一下,希望大家閱讀完這篇文章之后能夠有所收獲。
 
  MySQL下載
 
  MySQL直接去官網下載就行,選擇community版本(免費)下載,鏈接。
 
  Win10下怎么安裝配置mysql 8.0.20
 
  在select operating system中選擇Microsoft Windows,下方對應出現最新版本的MySQL,目前是MySQL 8.0.20,有兩個zip文件,選擇第一個Windows (x86, 64-bit), ZIP Archive點擊右側的Download按鈕進行下載
 
  官網下載有時速度比較慢,直接點擊鏈接也可以下載:mysql 8.0.20
 
  安裝與配置
 
  將下載好的壓縮包解壓縮到全英文目錄下,比如我在D盤新建了MySQL文件夾,解壓到該文件夾下,D:/MySQL
 
  Win10下怎么安裝配置mysql 8.0.20
 
  然后把mysql 8.0.20所在的路徑D:/MySQL/mysql-8.0.20-winx64添加到環境變量Path中
 
  Win10下怎么安裝配置mysql 8.0.20
 
  接下來正式安裝和配置MySQL:
 
  (一)首先在D:/MySQL/mysql-8.0.20-winx64路徑下創建一個my.ini文件,直接新建文本文檔,然后重命名為my.ini即可。
 
  Win10下怎么安裝配置mysql 8.0.20
 
  在文檔中添加以下內容:
  (注意修改basedir和datadir的路徑)
 
  [mysqld]
  # 設置3306端口
  port=3306
  # 設置mysql的安裝目錄
  basedir=D://MySQL//mysql-8.0.20-winx64 # 此處為mysql的解壓縮路徑
  # 設置mysql數據庫的數據的存放目錄
  datadir=D://MySQL//mysql-8.0.20-winx64//Data # 此處同上,先不要在路徑中創建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
  (二)以管理員權限打開cmd(注意要以管理員權限打開),并將路徑切換到D:/MySQL/mysql-8.0.20-winx64/bin
 
  Microsoft Windows [Version 10.0.18363.815]
  (c) 2019 Microsoft Corporation。保留所有權利。
 
  C:/Windows/system32>D:
 
  D:/>cd MySQL
 
  D:/MySQL>cd mysql-8.0.20-winx64
 
  D:/MySQL/mysql-8.0.20-winx64>cd bin
 
  D:/MySQL/mysql-8.0.20-winx64/bin>
  輸入mysqld --initialize --console,進行初始化。該步可以得到mysql的初始密碼,root@localhost后面那一串就是初始密碼,先記錄下來,待會要用到
 
  D:/MySQL/mysql-8.0.20-winx64/bin>mysqld --initialize --console
  2020-05-10T11:26:21.895908Z 0 [System] [MY-013169] [Server] D:/MySQL/mysql-8.0.20-winx64/bin/mysqld.exe (mysqld 8.0.20) initializing of server in progress as process 9764
  2020-05-10T11:26:21.897278Z 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-05-10T11:26:21.915225Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
  2020-05-10T11:26:22.619057Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
  2020-05-10T11:26:24.265774Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: 9Zh41zk-@mof
  輸入mysqld --install(如果需要安裝多個mysql服務,這步輸入mysqld --install [服務名])
 
  D:/MySQL/mysql-8.0.20-winx64/bin>mysqld --install
  Service successfully installed.
  顯示Service successfully installed則說明安裝成功
  輸入net start mysql,啟動MySQL服務
 
  D:/MySQL/mysql-8.0.20-winx64/bin>net start mysql
  The MySQL service is starting.
  The MySQL service was started successfully.
  輸入mysql -u root -p,使用初始密碼登錄mysql,在Enter password后輸入初始密碼
 
  D:/MySQL/mysql-8.0.20-winx64/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.20
 
  Copyright (c) 2000, 2020, 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.
  登錄后,把初始密碼修改掉,可以設置成自己容易記住的密碼。
  輸入ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '自己定義的密碼'; (分號一定要帶)
 
  mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '自己定義的密碼;
  Query OK, 0 rows affected (0.02 sec)
  到這一步就完成了
  輸入show database; ,可以查看包含哪些數據表
 
  mysql> show databases;
  +--------------------+
  | Database |
  +--------------------+
  | information_schema |
  | mysql |
  | performance_schema |
  | sys |
  +--------------------+
  4 rows in set (0.01 sec)
  看完這篇關于Win10下怎么安裝配置mysql 8.0.20的文章,如果覺得文章內容寫得不錯的話,可以把它分享出去給更多人看到。

(編輯:武林網)

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 潼关县| 阿尔山市| 闸北区| 曲阳县| 武宁县| 太白县| 龙泉市| 洛南县| 怀安县| 上蔡县| 册亨县| 石河子市| 上高县| 兴山县| 通榆县| 余干县| 无极县| 土默特左旗| 科技| 射洪县| 赤壁市| 开封市| 英吉沙县| 安福县| 奎屯市| 紫金县| 延长县| 简阳市| 屏东县| 读书| 奎屯市| 中方县| 岚皋县| 都江堰市| 织金县| 灌南县| 威远县| 邢台市| 连云港市| 兴业县| 乡城县|