win10安裝免安裝版的mysql5 7

2021-10-13 07:31:28 字數 3208 閱讀 9726

啟動服務

配置root密碼

本文講解的是win10下配置並安裝免安裝版的mysql5.7

我這裡將壓縮包,解壓縮我的d盤;解壓後完整的路徑為:d:\mydeveloper\mysql-5.7.29-winx64

新建資料夾:data

新建乙個檔案:my.ini

├── mysql-5.7.29-winx64

│ ├── bin

│ ├── data

│ ├── docs

│ ├── include

│ ├── lib

│ ├── license

│ ├── my.ini

│ ├── readme

│ └── share

配置my.ini檔案,內容如下:

[mysqld]

basedir ="d:\mydeveloper\mysql-5.7.29-winx64"

datadir ="d:\mydeveloper\mysql-5.7.29-winx64\data"

port=3306

server_id=10

character-set-server=utf8

character_set_filesystem=utf8

sql_mode=strict_trans_tables,no_zero_in_date,no_zero_date,error_for_division_by_zero,no_engine_substitution

[client]

port=3306

default-character-set=utf8

[mysqld_safe]

timezone="cst"

[mysql]

default-character-set=utf8

環境變數的path中,新建乙個,將mysql的bin目錄加進去,如下圖:

以管理員的方式執行powershell

依次執行:mysqld --install

mysqld --inlstall
提示安裝成功即可。

執行:mysqld --initialize-insecure --user=mysql

mysqld --initialize-insecure --user=mysql
沒有輸出表示安裝成功

執行: net start mysql 啟動mysql的服務,輸出的內容如下:

ps c:\windows\system32> net start mysql

mysql 服務正在啟動 .

mysql 服務已經啟動成功。

使用: mysql -u root -p 進行登入,輸入完成後敲回車;提示你輸入密碼,不用管,直接再次回車即可;輸入的內容如下:

ps 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.29 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.

mysql> use mysql

database changed

mysql> update user set authentication_string=password(

'root'

) where user=

'root'

;query ok, 1 row affected, 1 warning (0.00 sec)

rows matched: 1 changed: 1 warnings: 1

mysql> quit

bye

ps c:\windows\system32> net stop mysql

mysql 服務正在停止.

mysql 服務已成功停止。

ps c:\windows\system32> net start mysql

mysql 服務正在啟動 .

mysql 服務已經啟動成功。

ps 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.29 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.

mysql免安裝版配置 MySQL免安裝版配置教程

操作步驟 2 解壓到相應的安裝目錄,以 d program files environment mysql 為例 3 新增環境變數,在系統的path中配置mysql的bin目錄 d program files environment mysql bin 4 新建mysql配置檔案my.ini,放在m...

Win10配置免安裝版本MySQL5 7 31

1,在根目錄下新建my.ini 具體配置步驟引數如下。因為需要匯入別的專案的資料庫,這裡指定了服務端 客戶端字符集為utf8mb4。mysql port 3306 default character set utf8mb4 mysqld 設定為mysql的安裝目錄 basedir d mysql5....

MySQL免安裝版安裝

mysqld 設定3306埠 port 3306 設定mysql的安裝目錄 basedir d software tool mysql 8.0.18 winx64 切記此處一定要用雙斜槓 單斜槓這裡會出錯。設定mysql資料庫的資料的存放目錄 datadir d software tool mysq...