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

posted @ 2019-05-20 14:06  一只桔子2233  阅读(130)  评论(0编辑  收藏  举报