1. 程式人生 > >window下MySQL5.7解壓版安裝

window下MySQL5.7解壓版安裝

MySQL5.7安裝版只有32位的,遂選擇瞭解壓版

安裝步驟:

1.解壓檔案到指定目錄

我的解壓到了 D:\application\MySql-5.7.23

2.配置window服務

解壓好後每次都要手動啟動mysql服務,比較麻煩,配置window服務後可以設定開機啟動,當然也可以設定為手動。

  1. 管理員執行命令列視窗,定位到mysql的bin目錄下
  2. 初始化mysql,生成data資料夾: mysqld --initialize-insecure
  3. 新增mysql服務: mysqld -install
  4. 啟動mysql服務: net start mysql
  5. mysql預設預設賬戶為root,沒有設定密碼,直接mysql -u root即可進入mysql。這裡設定預設賬戶為root,密碼為000000:mysqladmin -u root password 000000

至此,安裝成功。

D:\application\MySql-5.7.23\bin>mysqld --initialize-insecure

D:\application\MySql-5.7.23\bin>mysqld -install
Service successfully installed.

D:\application\MySql-5.7.23\bin>net start mysql
MySQL 服務正在啟動 .
MySQL 服務已經啟動成功。

D:\application\MySql-5.7.23\bin>mysqladmin -u root password 000000
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
Warning: Since password will be sent to server in plain text, use ssl connection to ensure password safety.

D:\application\MySql-5.7.23\bin>mysql -uroot -p000000
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.23 MySQL Community Server (GPL)

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.

mysql> exit
Bye

設定mysql啟動方式:

1. 我的電腦右鍵——>管理——>服務和應用程式——>服務

2. 找到MySQL項,可以產看是否啟動,也可以右鍵-->屬性 設定啟動方式是自動還是手動