本文記錄了mysql 5.7.21安裝配置方法,具體內(nèi)容如下
1.下載
下載地址

解壓到自己喜歡的一個(gè)位置即可(目錄中不要包含中文)
如:D:/Program Files/
2.系統(tǒng)環(huán)境變量配置
(1)新增系統(tǒng)變量
         變量名:MYSQL_HOME
         變量值:Mysql解壓目錄,如D:/Program Files/mysql-5.7.21-winx64
(2)追加PATH
         ;%MYSQL_HOME%/bin;
3.配置my.ini文件
在解壓根目錄新建一個(gè)my.ini的文件
| # For advice on how to change settings please see# http://dev.mysql.com/doc/refman/5.6/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. [mysqld] # 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 = "D://Program Files/mysql-5.7.21-winx64" datadir = "D://Program Files/mysql-5.7.21-winx64/data" port = 3306 character_set_server = utf8 # 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 | 

4.管理員方式啟動(dòng)命令提示窗符
進(jìn)入mysql解壓目錄到bin目錄下
如:D:/Program Files/mysql-5.7.21-winx64/bin

分別執(zhí)行:
(1)初始化:mysqld -initialize-insecure

如果報(bào)錯(cuò)failed to set datadir to 則 執(zhí)行一下 mysqld --initialize --user=mysql --console,再執(zhí)行(1);
正確之后會(huì)在Mysql解壓根目錄生成data文件夾以及相關(guān)文件
(2)mysqld -install

*如提示Install/Remove of the Service Denied,說(shuō)明不是已管理員的方式進(jìn)入的命令提示符
(3)啟動(dòng)服務(wù):net start mysql
新聞熱點(diǎn)
疑難解答
圖片精選