MySql 调优
1、
2、code
-- 查询数据库表的行数
use information_schema;
select table_name,table_rows from tables where TABLE_SCHEMA = 'database' order by
table_rows desc;
-- 数据库系统相关
show global variables like "%datadir%";
-- set password for root@localhost = password('123');
-- 日期相关
select date_format(now(), '%Y-%m-%d') as nowStr;
select str_to_date('2019-01-02', '%Y-%m-%d %H') as date;
-- 重置清空 tableName 表 id 为1
truncate table tableName