版权声明:Summer https://blog.csdn.net/csdnyanglei/article/details/81116297
# rz
# sz
# mysql -u root -p1234
mysql> source /root/repair-180612.sql;
mysql> show variables like '%secure%';
mysql> select a.cn_name,a.en_name from table a where a.field=2 and a.enabled_flag=1 into outfile "/var/lib/mysql-files/18061301.txt";
#备份表结构、数据、函数和存储过程
mysql> mysqldump -R -E -u root -p database > /root/mysql-data/online-data/online-18061402.sql
#备份数据库部分表(-d 只备份结构,不加-d备份结构和数据)
mysqldump -uroot -p123456 -d database tablename1 > /root/mysqlbak/online-db-18061404.sql
#查询表自增序列当前值
SELECT Auto_increment FROM information_schema.`TABLES` WHERE Table_Schema='db'AND table_name = 'tablename';