Mysql中常用sql语句

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u012831423/article/details/73303248

1、SET SQL_SAFE_UPDATES=0;
有时候不用主键为查询参数进行操作会报错误,Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences -> SQL Queries and reconnect.
将安全更新关闭即可

2、show index from ‘table’
查询当前表的索引字段

3、lock table ‘xxx’ read;
锁表,只读操作

4、unlock tables 解锁表操作

5、show table status like ‘xxxx’ 查询该表的详细信息

猜你喜欢

转载自blog.csdn.net/u012831423/article/details/73303248