MySQLÊý¾Ý¿â±¸·ÝºÍ»¹ÔµÄ³£ÓÃÃüÁî
±¸·ÝMySQLÊý¾Ý¿âµÄÃüÁî
mysqldump -hhostname -uusername -ppassword databasename > backupfile.sql
±¸·ÝMySQLÊý¾Ý¿âΪ´øɾ³ý±íµÄ¸ñʽ
±¸·ÝMySQLÊý¾Ý¿âΪ´øɾ³ý±íµÄ¸ñʽ£¬Äܹ»Èøñ¸·Ý¸²¸ÇÒÑÓÐÊý¾Ý¿â¶ø²»ÐèÒªÊÖ¶¯É¾³ýÔÓÐÊý¾Ý¿â¡£
mysqldump -–add-drop-table -uusername -ppassword databasename > backupfile.sql
Ö±½Ó½«MySQLÊý¾Ý¿âѹËõ±¸·Ý
mysqldump -hhostname -uusername -ppassword databasename | gzip > backupfile.sql.gz
±¸·ÝMySQLÊý¾Ý¿âij¸ö(Щ)±í
mysqldump -hhostname -uusername -ppassword databasename specific_table1 specific_table2 > backupfile.sql
ͬʱ±¸·Ý¶à¸öMySQLÊý¾Ý¿â
mysqldump -hhostname -uusername -ppassword –databases databasename1 databasename2 databasename3 > multibackupfile.sql
½ö½ö±¸·ÝÊý¾Ý¿â½á¹¹
mysqldump –no-data –databases databasename1 databasename2 databasename3 > structurebackupfile.sql
±¸·Ý·þÎñÆ÷ÉÏËùÓÐÊý¾Ý¿â
mysqldump –all-databases > allbackupfile.sql
»¹ÔMySQLÊý¾Ý¿âµÄÃüÁî
mysql -hhostname -uusername -ppassword databasename < backupfile.sql
»¹ÔѹËõµÄMySQLÊý¾Ý¿â
gunzip < backupfile.sql.gz | mysql -uusername -ppassword databasename
½«Êý¾Ý¿âתÒƵ½Ð·þÎñÆ÷
mysqldump -uusername -ppassword databasename | mysql –host=*.*.*.* -C databasename
Ïà¹ØÎĵµ£º
MySQLµÄ±¸·Ý·½Ê½£¬Ä¿Ç°ÎÒÏëµ½µÄÓÐÎåÖÖ£¬ÓпÉÄÜ»¹ÓÐ
1£¬mysqldump·½Ê½£¬¼ÓÉϾßÌå²ÎÊýÃû£¨µ¥¿â£¬¶à¿â£¬´¥·¢Æ÷£¬´æ´¢¹ý³Ì£¬±í½á¹¹£¬×Ö·û¼¯£¬–single-transaction£¬µÈµÈ£©
2£¬mysqlhotcopy Ö»Äܱ¸·ÝmyisamÊý¾Ý±í±¸·Ý£¬ËÙ¶ÈÏ൱¿ì£¬ÒòΪÊÇÎļþ¿½±´£¬¿ÉÄÜ˲¼ä±»Ëø±í£¬ÈκεÄÊý¾Ý²Ù×÷£¬±ÈÈç²åÈëºÍ¸üж¼»á¹ÒÆð¡£
3£¬LVMµ ......
* mysqlÊ×ÏȽ«Äõ½µÄÊý¾Ýת»»Îªcharacter_set_clientÖ¸¶¨µÄ±àÂë¸ñʽ£¬È»ºóת»»Îª character_set_connectionÖ¸¶¨µÄ¸ñʽ£¬×îºóÔÙ½«Êý¾Ý´æ´¢µ½Êý¾Ý¿â£¬´æ´¢¸ñʽΪcharacter_set_databaseËùÖ¸¶¨µÄ¸ñʽ£»
* ´ÓÊý¾Ý¿â¶ÁÊý¾Ýʱ£¬½«Êý¾Ý¿â¸ñʽת»»Îªcharacter_set_resultsÖ¸¶¨µÄ¸ñʽ£¬ÔÙ·¢Ë ......
Òª°²×° MySQL£¬¿ÉÒÔÔÚÖÕ¶ËÌáʾ·ûºóÔËÐÐÏÂÁÐÃüÁ
sudo apt-get install mysql-server
sudo apt-get install mysql-client
sudo apt-get install php5-mysql
// °²×°php5-mysql Êǽ«phpºÍmysqlÁ¬½ÓÆðÀ´
Ò»µ©°²×°Íê³É£¬MySQL ·þÎñÆ÷Ó¦¸Ã×Ô¶¯Æô¶¯¡£Äú¿ÉÒÔÔÚÖÕ¶ËÌáʾ·ûºóÔËÐÐÒÔÏÂÃüÁîÀ´¼ì²é MySQL ·þÎñÆ÷ÊÇ·ñÕýÔÚÔËÐУº ......
·½·¨Ò»£º½¨Ò»¸öÆ´Òô±í t_cosler £¬´æ·Åÿ¸ö×Öĸ¿ªÍ·µÄµÚÒ»¸öºº×ֵıàºÅºÍ×îºóÒ»¸öºº×ֵıàºÅ¡£
BatchFile code
+------+--------+-------+
| f_PY | cBegin | cEnd |
+------+--------+-------+
| A | 45217 | 45252 |
| B | 45253 | 45760 |
.....
| Z | 54481 | 55289 |
+------+--------+------- ......
ÔÚmysqlÊý¾Ý¿âÖУ¬Ê¹ÓõÄÊÇlatin×Ö·û¼¯£¬ËùÒÔÎÞ·¨Õý³£µÄÖ§³ÖÖÐÎÄ×Ö·û£¬ÖÐÎÄÔÚÊý¾Ý¿âÖÐÏÔʾΪÂÒÂë“£¿”ºÅ¡£ÎªÁËÈÃmysql¿ÉÒÔÕý³£Ê¹ÓÃÖÐÎÄ£¬ÓÈÆäÊǵ±Ê¹ÓÃjspÁ¬½ÓmysqlµÄʱºò£¬ÎÒÃÇÐèҪʹÓÃgbkµÄ×Ö·û¼¯£¬Òò´ËÎÒÃÇÒª¶Ômysql½øÐÐÒÔÏÂÉèÖã¬ÒÔ±ãÆäÓÐЧµÄÖ§³ÖÖÐÎÄ£º
IXDBA.NET¼¼ÊõÉçÇø
1.ÐÞ¸Ämy.cnfÎļþ
my.cnfÎļþÊÇ ......