本地安裝 mysql,Pk10網站架設【企鵝21717-93408】官網下載對應版本安裝即可。
新啓終端輸入:
mysql -u root -p
1
接下來輸入密碼進入mysql。
mysql 顯示所有的數據庫,代碼如下:
show databases;
1
數據庫(database)操作:
create database test; // 建立 test 數據庫
drop database test; // 刪除
use test; //進入 test 數據庫
show tables; // 顯示數據庫下的所有表
表(table)操作:
create table mytable; // 建立表
drop table mytable; // 刪除表
delete from mytable; // 清空表
select * from mytable; // 顯示錶中所有內容
!