## 鏈接資料庫 ``` ## -h/-u這些後面沒有空格 ./bin/mysql -h[ip地址] -P[埠號] -u[用戶名] -p[密碼] ``` ## 查看建表語句 ```sql show create table [table_name] ``` ## 列出所有的資料庫 ```sql s... ...
鏈接資料庫
## -h/-u這些後面沒有空格
./bin/mysql -h[ip地址] -P[埠號] -u[用戶名] -p[密碼]
查看建表語句
show create table [table_name]
列出所有的資料庫
show databases;
列出所有的表
show tables;
模糊查找表名
show tables like '%aaa%';
client鏈接mysql的常用參數
jdbc:mysql://127.0.0.1:3306/mubiao?useUnicode=true&characterEncoding=UTF8&useSSL=false&serverTimezone=Asia/Shanghai
- useUnicode : 使用轉碼
- characterEncoding : 指定編碼方式
- useSSL : 是否使用SSL方式登錄
- serverTimezone : 指定資料庫服務的時區 . 否則datatime欄位的時區預設為+0 , 與北京時間不對