最近剛剛在win7系統安裝了mysql客戶端數據庫,現整理步驟供你們學習交流!html
1、下載mysql安裝包mysql
安裝包名稱:mysql-5.6.12-win32.zipsql
下載地址:http://dev.mysql.com/downloads/mysql/數據庫
(網盤分享:https://yunpan.cn/ckRxP5HBQ58ak 訪問密碼 d8e0)學習
2、安裝mysqlui
2.1 修改配置文件my.ini (將此文件放入安裝的目錄下)spa
將mysql-5.6.12-win32.zip解壓拷貝到D:\code
修改D:\mysql-5.6.12-win32.zip目錄下的配置文件my.ini以下:server
# 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 安裝mysqlhtm
以管理員身份啓動cmd,切換到目錄D:/mysql-5.6.12-win32/bin
安裝mysql:mysqld.exe --install(CMD中執行後,若是報拒絕,則須要用管理員權限運行CMD,而後執行該命令)
3、啓動mysql服務
3.1 啓動mysql服務
以管理員身份啓動cmd,切換到目錄D:/mysql-5.6.12-win32/bin
啓動mysql服務:net start MySQL
(若想在cmd命令中直接運行指令,而不用進入bin目錄下,須要在環境變量中增長路徑,如圖:
)
PS:系統默認的Mysql是自啓動的,修改成手工啓動的方法:
進入本機的「服務」,修改成手動啓動便可,如圖:
4、執行命令
4.1 登陸mysql
mysql -u root -p
輸入密碼(密碼爲空,直接回車),便可登陸。
修改root密碼爲123456:
mysql> use mysql;
Database changed
mysql> UPDATE user SET password=PASSWORD("123456") WHERE user='root';
4.2 執行mysql命令
5、卸載mysql
4.1 中止mysql服務
net stop MySQL
4.2 卸載mysql
mysqld.exe --remove