MySQL基礎命令

ali_yun_user發表於2018-11-15

a)啟動MySQL服務
windows: net start mysql
linux: service mysqld start
b)用命令列登入MySQL,檢查MySQL

mysql -u root -p
密碼
c)退出MySQL
quit

d)檢視當前環境下有哪些資料庫

show databases;

e)選擇使用某一個資料庫

use 資料庫名;

f)建立資料庫
create database class3;
加上字符集
create database class3 DEFAULT CHARACTER SET utf8;
g)檢視所選資料庫有哪些表

show tables;