MySQL常用语法

➡️数据表相关

➡️创建数据表

1
2
3
create database laravelS
DEFAULT CHARACTER SET utf8mb4
DEFAULT COLLATE utf8mb4_general_ci;

➡️清空数据表

1
truncate table 表名

➡️导出数据

1
2
3
mysql> SELECT * FROM runoob_tbl
-> INTO OUTFILE '/tmp/runoob.txt';
mysqldump -u root -p RUNOOB runoob_tbl > dump.txt