mysql-Client安裝(本次以windows10示范為例)
進(jìn)入官網(wǎng)下載頁面下載mysql-msi安裝包

本地附件 (下載后將文件后綴ZIP去掉即可)
安裝過程

勾選 license

本地只作為客戶端連接 Choosing Setup Type 選擇 Clinet only

后面緊跟下一步 Execute
 
通過客戶端連接

點(diǎn)擊MySQL Connection ? 添加連接

#Store in Vault 添加密碼
客戶端使用界面

有關(guān)更多 mysql Workbench 使用教程請(qǐng)參考官方文檔
mysql常用命令
連接
mysql -u <user> -h <ipaddress> -P <port> -p <password>
- -u參數(shù)為用戶名
- -h參數(shù)為數(shù)據(jù)庫地址
- -P大寫P參數(shù)為端口,mysql默認(rèn)為3306
- -p小寫p參數(shù)為密碼,不帶參數(shù)到命令行回車后則會(huì)被要求輸入(-p參數(shù)為可選參數(shù))
C:\Users\fuyun> mysql -u root -h 127.0.0.1 -p
Enter password:******
#登陸后會(huì)出現(xiàn)類似如下提示
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2854760 to server version: 5.0.9
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
#退出
mysql>exit
bye
C:\Users\fuyun>
增刪改查
C:\Users\fuyun> mysql -u root -h 127.0.0.1 -p
Enter password:****** # 登錄后進(jìn)入終端
#創(chuàng)建數(shù)據(jù)庫
mysql> create DATABASE FUYUN;
#展示數(shù)據(jù)庫
mysql> show DATABASES;
#選擇數(shù)據(jù)庫
mysql> use RUNOOB;
Database changed
#創(chuàng)建數(shù)據(jù)表
mysql> use FUYUN;
Database changed
mysql> CREATE TABLE fuyun_tbl(
-> fuyun_id INT NOT NULL AUTO_INCREMENT,
-> fuyun_title VARCHAR(100) NOT NULL,
-> fuyun_author VARCHAR(40) NOT NULL,
-> submission_date DATE,
-> PRIMARY KEY ( fuyun_id )
-> )ENGINE=InnoDB DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.16 sec)
mysql>
#注意:MySQL命令終止符為分號(hào) ;
#注意: -> 是換行符標(biāo)識(shí),不要復(fù)制
#查詢數(shù)據(jù)表
mysql> select * from fuyun_tbl;
#插入數(shù)據(jù)
mysql> INSERT INTO fuyun_tab1 ( fuyun_id, fuyun_title,fuyun_author )
VALUES
( value1, value2,value3 );
#刪除數(shù)據(jù)庫
mysql> DROP TABLE fuyun_tbl
Query OK, 0 rows affected (0.1 sec)
#退出
mysql> quit
bye
|