MySQL 5.0.16 ÂÒÂëÎÊÌâ´¦Àí°ì·¨
1 ÉèÖÃphpMyAdmin
Language:Chinese simplified (zh-utf-8)
MySQL ×Ö·û¼¯£ºUTF-8 Unicode (utf8)
MySQL Á¬½ÓУ¶Ô gbk_chinese_ci
2 ´´½¨Êý¾Ý¿âʱ
ÕûÀíÉèÖÃ³É gbk_chinese_ci
3 ÓÃSQL½¨Á¢±íÖÐ
ENGINE=MyISAM DEFAULT CHARSET=gbk;
ENGINE=InnoDB DEFAULT CHARSET=gbk AUTO_INCREMENT=40 ;
4 ¼ì²é±í½á¹¹ÖÐ
varchar(100) µÄÕûÀíÊôÐÔΪgbk_chinese_ci
ÆäËüÀàÐ͵ÄÕûÀíÊôÐÔΪ¿Õ
5 ´úÂëÖмÓÉÏ
$db->query("SET CHARACTER SET GBK"); LinuxÏÂÐèÒª£¬Windowsϲ»ÐèÒª
Õâ¸öÏ൱ÓÚConnection Character Sets and Collations
Ïà¹ØÎĵµ£º
1. Í£µ½ÔËÐеÄmysql: /etc/init.d/mysql stop
2. ʹÓÃskip-grant-tablesÕâ¸öÑ¡ÏîÆô¶¯MySQL£º /usr/bin/mysqld_safe --skip-grant-tables &
3. ÏÖÔÚ¿ÉÒÔ²»ÓÃÃÜÂë½øÈëmysql ÁË¡£
# myql
>   ......
1. Mysql Åàѵ
1.1. ÅàѵĿµÄ
±¾ÎĵµÊÇÕë¶ÔMySQL Êý¾Ý¿â·½ÃæµÄ»ù´¡Åàѵ£¬ÎªÁËʹÏîÄ¿×é³ÉÔ±Äܹ»´ïµ½Ê¹ÓÃMySQL Êý¾Ý¿âµÄÄ¿µÄ¡£
1.2. Åàѵ¶ÔÏó
¿ª·¢ÈËÔ±
1.3. ³£Óôʼ°·ûºÅ˵Ã÷
³£Óôʣº
Mysql£ºÒ»ÖÖÃâ·ÑµÄ¿çƽ̨µÄÊý¾Ý¿âϵͳ
E:\mysql£º±íʾÊÇÔÚdos ÃüÁî´°¿ÚÏÂÃæ
mysql> ±íʾÊÇÔÚmysql µÄÃüÁîÐÐÏÂ
1.4 ......
¼Ù¶¨±ítbl_name¾ßÓÐÒ»¸öPRIMARY KEY»òUNIQUEË÷Òý£¬±¸·ÝÒ»¸öÊý¾Ý±íµÄ¹ý³ÌÈçÏ£º
1¡¢Ëø¶¨Êý¾Ý±í£¬±ÜÃâÔÚ±¸·Ý¹ý³ÌÖУ¬±í±»¸üÐÂ
mysql>LOCK
TABLES READ tbl_name;
¹ØÓÚ±íµÄËø¶¨µÄÏêϸÐÅÏ¢£¬½«ÔÚÏÂÒ»Õ½éÉÜ¡£
2¡¢µ¼³öÊý¾Ý
mysql>SELECT
* INTO OUTFILE ‘tbl_name.bak’ from tbl_name;
3¡¢½âË ......
¡¡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ÓÐÒ»¸ö¹¦ÄܾÍÊÇ¿ÉÒÔlogÏÂÀ´ÔËÐеıȽÏÂýµÄsqlÓï¾ä£¬Ä¬ÈÏÊÇûÓÐÕâ¸ölogµÄ£¬ÎªÁË¿ªÆôÕâ¸ö¹¦ÄÜ£¬
ÒªÐÞ¸Ämy.cnf»òÕßÔÚmysqlÆô¶¯µÄʱºò¼ÓÈëһЩ²ÎÊý¡£Èç¹ûÔÚmy.cnfÀïÃæÐ޸ģ¬ÐèÔö¼ÓÈçϼ¸ÐÐ
long_query_time = 1
log-slow-queries = /var/youpath/slow.log
log-queries-not-using-indexes
long_query_time ÊÇÖ¸Ö´ ......