1. 清除表数据,包含初始化自增id

TRUNCATE table tb_name;

2. 查看数据库版本
select version();

MySQL常用指令

3. 查看创建表结构语句
show create table groups;

MySQL常用指令

4. 查看数据库字符集编码,可用来分析解决中文乱码
show VARIABLES like '%character%';

MySQL常用指令

5. 查看数据库允许执行的单条长语句大小限制
show VARIABLES like '%max_allowed_packet%';

MySQL常用指令

6. 解释语句执行过程,常用来调试优化sql语句

explain select * from tb_name where id =2813;

MySQL常用指令

相关文章:

  • 2022-03-02
  • 2021-09-29
  • 2021-12-15
  • 2021-09-11
  • 2021-12-28
  • 2022-01-05
  • 2022-12-23
猜你喜欢
  • 2022-03-01
  • 2022-02-23
  • 2021-05-29
  • 2022-12-23
  • 2021-07-17
相关资源
相似解决方案