当前位置: 移动技术网 > IT编程>数据库>Mysql > MySQL常用命令.md

MySQL常用命令.md

2020年01月06日  | 移动技术网IT编程  | 我要评论

链接数据库

## -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 , 与北京时间不对

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网