mysql 5.7.21 winx64綠色版安裝配置方法圖文教程
本文記錄了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,說明不是已管理員的方式進(jìn)入的命令提示符
(3)啟動(dòng)服務(wù):net start mysql
(4)登陸,改密碼 mysql -u root -p
【成功登陸的直接到(5)】
我的出現(xiàn)了
在my.ini中增加
重啟服務(wù),成功登陸
(5)執(zhí)行改密碼語(yǔ)句 (正常登陸的使用set password= password(‘新密碼'); )
update user set authentication_string = password("新密碼") where user='root';
(6)exit; net stop mysql
(7)登陸成功的忽略這一步
到my.ini中注釋掉
重啟進(jìn)入之后set password= password(‘新密碼');
到此就可以正常使用了。
(8)測(cè)試 show databases;
5.寫兩個(gè)bat文件用于啟動(dòng)和關(guān)閉mysql服務(wù)
(1)啟動(dòng)mysql服務(wù)
@echo off echo 確定要啟動(dòng)MySQL服務(wù)嗎? pause net start mysql echo 啟動(dòng)MySQL服務(wù)完成,請(qǐng)確認(rèn)有沒有錯(cuò)誤發(fā)生。 Pause
保存為 mysql服務(wù)啟動(dòng).bat 文件,運(yùn)行時(shí)要以管理員方式運(yùn)行
(2)關(guān)閉mysql服務(wù)
@echo off echo 確定要關(guān)閉MySQL服務(wù)嗎? pause net stop mysql echo 關(guān)閉MySQL服務(wù)完成,請(qǐng)確認(rèn)有沒有錯(cuò)誤發(fā)生。 Pause
保存為 mysql服務(wù)關(guān)閉.bat 文件,運(yùn)行時(shí)要以管理員方式運(yùn)行
MySql到此安裝結(jié)束。
精彩專題分享:
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
Mysql實(shí)現(xiàn)水平分庫(kù)的示例代碼
本文主要介紹了Mysql實(shí)現(xiàn)水平分庫(kù)的示例代碼,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2023-06-06使用sysbench來測(cè)試MySQL性能的詳細(xì)教程
這篇文章主要介紹了使用sysbench來測(cè)試MySQL性能的詳細(xì)教程,包括介紹了從sysbench的編譯安裝到初始化測(cè)試庫(kù)環(huán)境等一系列操作,需要的朋友可以參考下2015-05-05mysql count詳解及函數(shù)實(shí)例代碼
這篇文章主要介紹了mysql count詳解及函數(shù)實(shí)例代碼的相關(guān)資料,需要的朋友可以參考下2017-01-01解決MySQL5.1安裝時(shí)出現(xiàn)Cannot create windows service for mysql.error
這篇文章主要介紹了解決MySQL5.1安裝時(shí)出現(xiàn)Cannot create windows service for mysql.error:0問題的方法2016-06-06