MySQLÖÐÎÄÂÒÂë½â¾ö·½°¸
˵Ã÷: ÔÚMYSQLÖУ¬Èç¹ûʹÓÃȱʡµÄ×Ö·û¼¯£¬ÔÚ½¨¿â¡¢½¨±íʱ£¬Ä¬ÈÏʹÓõÄÊÇlatin1×Ö·û¼¯£¬
ΪISO 8859-1Î÷Å·×Ö·û¼¯¡£²åÈëÖÐÎÄ×Ö·ûʱ£¬ÓëÖ®²»Æ¥Å䣬¾Í»á³öÏÖÂÒÂë¡£
¡¾½â¾ö·½°¸¡¿
1. ´ò¿ªÎļþ: C:\Program Files\MySQL\MySQL Server 5.0\my.ini;
2. ½«ÆäÖеÄdefault-character-set=latin1¸ÄΪdefault-character-set=gb2312,
È»ºóÖØÆôMYSQL(ÒÔǰ½¨Á¢µÄÊý¾Ý¿âÐèÖØ½¨);
²âÊÔ: ÔËÐÐMySQL Command Line Client:
ÊäÈëshow variables like 'character_set_%';
¿ÉÒԲ鿴Êý¾Ý¿âµÄ×Ö·û±àÂëÈçÏÂ:
mysql> show variables like 'character_set_%';
+--------------------------+-----------------------------------------+
| Variable_name | Value
+--------------------------+-----------------------------------------+
| character_set_client | gb2312
| character_set_connection | gb2312
| character_set_database | gb2312
| character_set_filesystem | binary
| character_set_results | gb2312
| character_set_server | gb2312 &n
Ïà¹ØÎĵµ£º
http://hi.baidu.com/thinkinginlamp/blog/item/a352918fe70d96fd503d925e.html
2009Äê01ÔÂ12ÈÕ ÐÇÆÚÒ» ÏÂÎç 08:35
×÷ÕߣºÀÏÍõ
ÔÚÍøÉÏËæ±ãËÑËÑ£¬¾ÍÄÜÕÒµ½´ó°ÑµÄ¹ØÓÚMySQLÓÅ»¯µÄÎÄÕ£¬²»¹ýÀïÃæºÜ¶à¶¼²»×¼È·£¬Ëµ¸ö³£¼ûµÄ£º
SELECT a from ... WHERE b = ...
Ò»°ãÀ´Ëµ£¬ºÜ¶àÎÄÕÂ»á¸æ½ëÄãÀàËÆÕâÑùµÄ²éѯ£¬²»ÒªÔÚ“a ......
1.±àдshell½Å±¾
vi /data/www/project_name/bin/mysql_backup.sh
#!/bin/bash
#This is a ShellScript For Auto DB Backup
#Powered by liuzheng
#ϵͳ±äÁ¿¶¨Òå
DBName=test
DBUser=root
DBPasswd=123456
BackupPath=/tmp/mysql_backup/
NewFile="$BackupPath"db$(date +%y%m%d ......
1)¡¢back_log£º
ÒªÇó MySQL ÄÜÓеÄÁ¬½ÓÊýÁ¿¡£µ±Ö÷ÒªMySQLÏß³ÌÔÚÒ»¸öºÜ¶Ìʱ¼äÄڵõ½·Ç³£¶àµÄÁ¬½ÓÇëÇó£¬Õâ¾ÍÆð×÷Óã¬È»ºóÖ÷Ï̻߳¨Ð©Ê±¼ä(¾¡¹ÜºÜ¶Ì)¼ì²éÁ¬½Ó²¢ÇÒÆô¶¯Ò»¸öÐÂÏ̡߳£
back_logÖµÖ¸³öÔÚMySQLÔÝʱֹͣ»Ø´ðÐÂÇëÇó֮ǰµÄ¶Ìʱ¼äÄÚ¶àÉÙ¸öÇëÇó¿ÉÒÔ±»´æÔÚ¶ÑÕ»ÖС£Ö»ÓÐÈç¹ûÆÚÍûÔÚÒ»¸ö¶Ìʱ¼äÄÚÓкܶàÁ¬½Ó£¬ÄãÐèÒªÔ ......
1)¡¢back_log£º
ÒªÇó MySQL ÄÜÓеÄÁ¬½ÓÊýÁ¿¡£µ±Ö÷ÒªMySQLÏß³ÌÔÚÒ»¸öºÜ¶Ìʱ¼äÄڵõ½·Ç³£¶àµÄÁ¬½ÓÇëÇó£¬Õâ¾ÍÆð×÷Óã¬È»ºóÖ÷Ï̻߳¨Ð©Ê±¼ä(¾¡¹ÜºÜ¶Ì)¼ì²éÁ¬½Ó²¢ÇÒÆô¶¯Ò»¸öÐÂÏ̡߳£
back_logÖµÖ¸³öÔÚMySQLÔÝʱֹͣ»Ø´ðÐÂÇëÇó֮ǰµÄ¶Ìʱ¼äÄÚ¶àÉÙ¸öÇëÇó¿ÉÒÔ±»´æÔÚ¶ÑÕ»ÖС£Ö»ÓÐÈç¹ûÆÚÍûÔÚÒ»¸ö¶Ìʱ¼äÄÚÓкܶàÁ¬½Ó£¬ÄãÐèÒªÔ ......