標籤:
最近剛剛在win7系統安裝了mysql用戶端資料庫,現整理步驟供大家學習交流!
一、下載mysql安裝包
安裝包名稱:mysql-5.6.12-win32.zip
:http://dev.mysql.com/downloads/mysql/
(網盤分享:https://yunpan.cn/ckRxP5HBQ58ak 訪問密碼 d8e0)
二、安裝mysql
2.1 修改設定檔my.ini (將此檔案放入安裝的目錄下)
將mysql-5.6.12-win32.zip解壓拷貝到D:\
修改D:\mysql-5.6.12-win32.zip目錄下的設定檔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.[client]default-character-set=utf8[mysql]default-character-set=utf8[mysqld]character-set-server=utf8# 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:/mysql-5.6.16-winx64 datadir = D:/mysql-5.6.16-winx64/data# 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
2.2 安裝mysql
以管理員身份啟動cmd,切換到目錄D:/mysql-5.6.12-win32/bin
安裝mysql:mysqld.exe --install(CMD中執行後,如果報拒絕,則需要用管理員權限運行CMD,然後執行該命令)
三、啟動mysql服務
3.1 啟動mysql服務
以管理員身份啟動cmd,切換到目錄D:/mysql-5.6.12-win32/bin
啟動mysql服務:net start MySQL
(若想在cmd命令中直接運行指令,而不用進入bin目錄下,需要在環境變數中增加路徑,
)
PS:系統預設的Mysql是自啟動的,修改為手工啟動的方法:
進入原生“服務”,修改為手動啟動即可,
四、執行命令
4.1 登入mysql
mysql -u root -p
輸入密碼(密碼為空白,直接斷行符號),即可登入。
修改root密碼為123456:
mysql> use mysql;Database changedmysql> UPDATE user SET password=PASSWORD("123456") WHERE user=‘root‘;
4.2 執行mysql命令
五、卸載mysql
4.1 停止mysql服務
net stop MySQL
4.2 卸載mysql
mysqld.exe --remove
Win7下安裝Mysql方法