天天看點

mysqld/mariadb常用語句

create database if not exists hidb; #建立庫,如果此庫不存在

show warnings; #檢視db最近一次的告警

alter database hidb character set 'utf-8'; #設定資料庫字元集

drop database testdb; #删除庫

show databases like '%db'; #查詢以db結尾的資料庫資訊

help show databases; #幫助

create table tbl2 (id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE KEY,name VARCHAR(60) NOT NULL); #建立表結構