MYsql ÒìµØ±¸·Ý½Å±¾
ÔÚÒìµØµÄ·þÎñÆ÷±¸·ÝMysqlʱ£¬ÒìµØµÄ·þÎñÆ÷ûÓа²×°MysqlÊý¾Ý¿â£¬±¸·ÝµÄmysqldumpÃüÁîÊDz»ÄÜÉúЧµÄ¡£ËùÒÔ¿ÉÒÔ°Ñ°²×°mysqlÊý¾Ý¿âËùÔÚ·þÎñÆ÷ÖеÄmysqldump.exe£¨È磺C:\Program Files\MySQL\MySQL Server 5.0\binĿ¼ÖеÄmysqldump.exe£©¿½±´µ½ÒìµØ·þÎñÆ÷ÖеÄÒ»¸öĿ¼ÖУ¨È磺F:\MySQLBackup£©¡£
±ÈÈçÎļþÃûΪ£ºPersonBackupMonday.bat£¬Ë«»÷Îļþ¼´¿É¡£»òÕßÓÃwindowsµÄÈÎÎñ¼Æ»®¶¨Ê±Ö´ÐиÃÎļþ¡£
ÎļþÄÚÈÝÈçÏ£º
cd F:\MySQLBackup
f:
mysqldump -h ip -uusername -ppassword dbname>F:\MySQLBackup\PersonBackupMonday.sql
username£ºÊý¾Ý¿âÓû§
password£ºÊý¾Ý¿âÃÜÂë
dbname£ºÊý¾Ý¿âÃû³Æ
»Ö¸´Êý¾Ý£º¿ÉÒÔ°ÑÊý¾Ý¿½±´µ½Êý¾Ý¿âµÄ·þÎñÆ÷ÖÐ
C:\Documents and Settings\Administrator>mysql -u username –p
ÃÜÂ룺password
mysql> use dbname;
mysql> source F:\MySQLBackup\PersonBackupMonday.sq
Ïà¹ØÎĵµ£º
Ê×ÏÈÉèÖÃMySQLÖ÷·þÎñÆ÷£º
ÔÚÖ÷·þÎñÆ÷ÉÏΪ´Ó·þÎñÆ÷½¨Á¢Ò»¸öÓû§£º
grant replication slave on *.* to 'Óû§Ãû'@'Ö÷»ú' identified by 'ÃÜÂë';
Èç¹ûʹÓõÄÊÇMySQL 4.0.2֮ǰµÄ°æ±¾£¬ÔòÓÃfileȨÏÞÀ´´úÌæreplication slave
±à¼Ö÷·þÎñÆ÷µÄÅäÖÃÎļþ£º/etc/my.cnf
server-id=1
log-bin
binlog-do-db=ÐèÒª¸´ÖƵÄÊý¾Ý¿âÃû£ ......
MySQLµ¼Èëµ¼³öÃüÁî
1.µ¼³öÕû¸öÊý¾Ý¿â
¡¡¡¡mysqldump -u Óû§Ãû -p Êý¾Ý¿âÃû > µ¼³öµÄÎļþÃû
¡¡¡¡mysqldump -u wcnc -p smgp_apps_wcnc > wcnc.sql
2.µ¼³öÒ»¸ö±í
¡¡¡¡mysqldump -u Óû§Ãû -p Êý¾Ý¿âÃû ±íÃû> µ¼³öµÄÎļþÃû
¡¡¡¡mysqldump -u wcnc -p smgp_apps_wcnc users> wcnc_users.sql
3.µ¼³öÒ ......
¹ØÓÚMySQL±íÉè¼ÆÓ¦¸Ã×¢ÒâµÄÎÊÌâ(×öÁ˵ãÐÞ¸Ä)
¹Ø
ÓÚÉè¼Æ±íʱӦ¸Ã×¢ÒâµÄÎÊÌâ
ÈçÓдíÎó»¶Ó´ó¼ÒÖ¸³ö¡£Õâ
¶Îʱ¼äÔÚ¼ÒÀ×öÁ˵ãÐÞÕý¡£
1
¡¢É÷ÖØÑ¡Ôñ±íÃû¡£
ÓÐ
Á½ÖÖÑ¡Ôñ£º
°´ÕÕ ......
drop procedure if exists pro_rep_shadow_rs;
delimiter |
----------------------------------
-- rep_shadow_rs
-- ÓÃÀ´´¦ÀíÐÅÏ¢µÄÔö¼Ó£¬¸üкÍɾ³ý
-- ÿ´ÎÖ»¸üÐÂÉÏ´ÎÒÔÀ´Ã»ÓÐ×ö¹ýµÄÊý¾Ý
-- ¸ù¾Ý²»Í¬µÄ±ê־λ
-- ÐèÒªÒ»¸öÊä³öµÄ²ÎÊý£¬
-- Èç¹û·µ»ØΪ0£¬Ôòµ÷ÓÃʧ°Ü£¬ÊÂÎñ»Ø¹ö
-- Èç ......