MySQL常用命令.md

Posted 孙行者、

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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 , 与北京时间不对

以上是关于MySQL常用命令.md的主要内容,如果未能解决你的问题,请参考以下文章

提效小技巧——记录那些不常用的代码片段

Linux常用命令——md5sum

markdown 卷曲常用命令.MD

ini nginx的常用命令和配置.MD

linux中怎么查看mysql数据库版本

常用Linux命令