1.在mysql官網下載社區版的mysql :
http://dev.mysql.com/downloads/mysql/
2.解壓版本,下載後只需要解壓到指定目錄,如D:\program files\mysql。
3.安裝服務
去cmd命令窗口,進入mysql\bin目錄,輸入命令安裝:mysqld –install
具體操作如下:
但是出錯了:install/remove of the service denied
出錯原因:權限不夠
解決方法:重新打開cmd.exe,然後右鍵,用管理員身份打開。
再次輸入命令mysqld –install ,就提示Service successfully installed.
4.開啓服務 輸入:net start mysql
如下是在cmd環境下輸入命令後的顯示:
D:\program files\mysql\bin>net start mysql
MySQL 服務正在啓動..
MySQL 服務已經啓動成功。
5.直接登錄mysql , 輸入: mysql -uroot (登錄本機下的root賬號,沒有密碼)
mysql在windows下默認沒有密碼,在linux下默認有密碼。 如下是cmd環境下的顯示:
D:\program files\mysql\bin>mysql -uroot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.31 MySQL Community Server (GPL)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
mysql>
6.退出數據庫服務器登錄
mysql>\q
mysql>quit
mysql>exit
7.卸載mysql服務
進入mysql\bin下,先停止服務,然後移除:
D:\program files\mysql\bin>net stop mysql 停止正在運行的服務
D:\program files\mysql\bin>mysqld –remove 移除mysql的安裝服務
爲了卸載乾淨,建議手動把D:\program files\mysql文件包刪除。