mysql常用语句(持续更新)
查询数据库中各表数量
select table_name,table_rows from information_schema.tables where TABLE_SCHEMA = 'miot' order by table_rows desc;
数据库创建用户,并赋权限
CREATE USER 'sonar' IDENTIFIED BY 'sonar';
GRANT ALL ON sonar.* TO 'sonar'@'%' IDENTIFIED BY 'sonar' WITH GRANT OPTION;;
GRANT ALL ON sonar.* TO 'sonar'@'localhost' IDENTIFIED BY 'sonar' WITH GRANT OPTION;;
FLUSH PRIVILEGES;
select * from user;
#特殊字符
GRANT ALL PRIVILEGES ON `intelligent-family`.* TO 'familyConsole'@'%' identified by '123456' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON `intelligent-family`.* TO 'familyConsole'@'localhost' identified by '123456' WITH GRANT OPTION;
FLUSH PRIVILEGES;
查询数据库线程使用
定位问题原因*
根据原因思考问题解决方案*
实践验证方案有效性*
提交验证结果