忽略一些表导出数据库
mysqldump -h 10.66.125.xx -u xx -p xx -t test_db --ignore-table=test_db.manalog --ignore-table=test_db.user_play_history > test_db_bak.sql;
全部导出
mysqldump -u xxx -p xxx > test_db.sql
去除权限
sed -e 's/DEFINER[ ]*=[ ]*[^*]*\*/\*/ ' backup.sql > new_backup.sql
创建用户
CREATE USER 'julian'@'localhost' IDENTIFIED BY '123456';
权限
grant all privileges on *.* to 'julian'@'%' identified by '123456'; flush privileges;
创建发生错误,需要修改my.cnf
insert into mysql.user(Host,User,Password) values("localhost","julian",password("123456"));
忽略表名大小写
lower_case_table_names=1