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;

查询数据库线程使用

上一篇:sonar windows教程 不用mysql


下一篇:jenkins sonar