MySQL常用命令.md

链接数据库

## -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 , 与北京时间不对
posted @ 2020-01-06 11:43  孙行者、  阅读(425)  评论(0编辑  收藏  举报