該方法已經(jīng)在win10 v1903企業(yè)版和MySQL v上測試過8.0.16
1. 下載MySQL zip文件并解壓到D:\MySQL目錄mysql
https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.16-winx64.zip
2. 在 D:\MySQL 中新建一個 my.ini 文件并編輯以下 sql
# For advice on how to change settings please see # http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html # *** DO NOT EDIT THIS FILE. It's a template which will be copied to the # *** default location during install, and will be replaced if you # *** upgrade to a newer version of MySQL. [client] port = 3306 [mysql] default-character-set = utf8 [mysqld] port = 3306 basedir = D:\MySQL datadir = D:\MySQL\data character_set_server = utf8 max_connections = 60 # Remove leading # and set to the amount of RAM for the most important data # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%. # innodb_buffer_pool_size = 128M # Remove leading # to turn on a very important data integrity option: logging # changes to the binary log between backups. # log_bin # These are commonly set, remove the # and set as required. # basedir = ..... # datadir = ..... # port = ..... # server_id = ..... # Remove leading # to set options mainly useful for reporting servers. # The server defaults are faster for transactions and fast SELECTs. # Adjust sizes as needed, experiment to find the optimal values. # join_buffer_size = 128M # sort_buffer_size = 2M # read_rnd_buffer_size = 2M sql_mode = NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES default_authentication_plugin = mysql_native_password
3.初始化數(shù)據(jù)文件綠色版mysql不能登陸裝飾花紋筆刷下載2檔案圖像處理系統(tǒng)Ps音樂盛會宣傳海報素材,在命令提示符下輸入bash
mysqld --initialize-insecure
此時啟動服務后綠色版mysql不能登陸,就可以用root和空密碼登錄了。網(wǎng)絡
4.修改root密碼測試
修改本地root密碼ui
mysqld --initialize-insecure
修改網(wǎng)絡root密碼代碼
此時本機和網(wǎng)絡可以使用root密碼登錄cdn
5.支持
新建start.bat并輸入
@echo off echo Starting MySQL Server... RunHiddenConsole D:/MySQL/bin/mysqld.exe exit
新建一個stop.bat并輸入
@echo off echo Stopping MySQL Server... taskkill /F /IM mysqld.exe > nul exit