mysql常规应用
时间:2010-05-13 来源:billsuliang
备份
mysqldump -u user -p db1 tab1 tab2 > db1.sql mysqldump -uroot –p db1 > $(date +%Y%m%d)-db1.sql tar -zcvf $(date +%Y%m%d)mysql.tar.gz ./$(date +%Y%m%d)* find /home/backup/ -mtime +30 -name "*.gz" -exec rm -rf {} \; 恢复
mysql -u user -p db1 < db1.sql 用户管理 select * from mysql.user\G;
select * from mysql.db\G; grant all on *.* to [email protected] identified by "123456"; REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'root'@'127.0.0.1'; delete from mysql.user where user='root'; flush privileges;
mysqldump -u user -p db1 tab1 tab2 > db1.sql mysqldump -uroot –p db1 > $(date +%Y%m%d)-db1.sql tar -zcvf $(date +%Y%m%d)mysql.tar.gz ./$(date +%Y%m%d)* find /home/backup/ -mtime +30 -name "*.gz" -exec rm -rf {} \; 恢复
mysql -u user -p db1 < db1.sql 用户管理 select * from mysql.user\G;
select * from mysql.db\G; grant all on *.* to [email protected] identified by "123456"; REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'root'@'127.0.0.1'; delete from mysql.user where user='root'; flush privileges;
相关阅读 更多 +