如何配置解壓版MySQL

2021-07-23 01:24:20 字數 1733 閱讀 9934

此處以mysql-5.7.14-winx64為例,本人親自測試:

1.  新增d:\mysql\mysql-5.7.14-winx64\bin目錄到環境變數path

2.  d:\mysql\mysql-5.7.14-winx64目錄下新建data資料夾

3. d:\mysql\mysql-5.7.14-winx64目錄下新建my.ini檔案,路徑根據實際情況填寫,內容如下:

[mysqld]

basedir = d:\mysql-5.7.12-win32

datadir = d:\mysql-5.7.12-win32\data

port = 3306

sql_mode=no_engine_substitution,strict_trans_tables 

character-set-server=utf8

4. 安裝:

mysqld install

(出現 service successfully installed)

mysqld --initialize-insecure --user=mysql

(輸入完此指令回車後需要等待一會)

5. 啟動:

net start mysql  (前面操作均無異常情況下,出現mysql服務正在啟動,等待一會出現mysql服務已經啟動成功)

6. 測試連線資料庫, 剛安裝沒有密碼,直接回車

mysql -u root -p

(出現:

c:\windows\system32>mysql -u root -p

enter password:

welcome to the mysql monitor.  commands end with ; or \g.

your mysql connection id is 2

server version: 5.7.14 mysql community server (gpl)

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.

)7. 修改root密碼

set password for root@localhost = password('rootroot'); (' '裡面為新密碼)

(出現:query ok, 0 rows affected, 1 warning (0.00 sec))

8. 允許遠端連線

use mysql;

(出現:database changed)

update user set host = '%' where user = 'root';

(出現:query ok, 1 row affected (0.00 sec)

rows matched: 1  changed: 1  warnings: 0)

select host, user from user;

grant all privileges on *.* to 'root'@'%' with grant option;

flush privileges;

到這裡,整個mysql就配置完成了!

mysql解壓版配置

1 修改配置環境,在環境變數的 系統環境變數裡的path新增mysql存放的位址 2 修改mysql.ini檔案 將下面兩個位址改為自己的位址 basedir datadir basedir d 工具包 mysql 5.6.21 winx64 datadir d 工具包 mysql 5.6.21 w...

解壓版mysql簡單配置

一 軟體環境 mysql 5.5.8 win32,windows 2003 enterpries edition 二 解壓版的安裝 1 在主目錄下建立my.ini檔案 我是放在 d program files mysql 5.5.8 win32 內容如下 winmysqladmin 指定mysql服...

MYSQL解壓版配置詳解

解壓mysql f program files mysql mysql安裝目錄 二 新建my.ini 在f program files mysql 下建立my.ini檔案,內容為 my.ini mysqld 設定mysql的安裝目錄 basedir f program files mysql 設定m...