Mysql¿ªÆôÈÕÖ¾
ÔÎÄת×Ô:http://hi.baidu.com/jackli00/blog/item/21b2e242025bfa1473f05d24.html
Mysql¿ªÆôÈÕÖ¾
2008-11-18 11:23
ÊÇ·ñÆôÓÃÁËÈÕÖ¾
mysql>show variables like 'log_bin';
ÔõÑùÖªµÀµ±Ç°µÄÈÕÖ¾
mysql> show master status;
¿´¶þ½øÖÆÈÕÖ¾ÎļþÓÃmysqlbinlog
shell>mysqlbinlog mail-bin.000001(Ҫд¾ø¶ÔÎÊÌâ·¾¶¡¡d://)
»òÕßshell>mysqlbinlog mail-bin.000001 | tail
Windows ÏÂÓÃÀàËƵÄÃüÁî¡£
mysqlÓÐÒÔϼ¸ÖÖÈÕÖ¾£º
´íÎóÈÕÖ¾£º -log-err
²éѯÈÕÖ¾£º -log
Âý²éѯÈÕÖ¾: -log-slow-queries
¸üÐÂÈÕÖ¾: -log-update
¶þ½øÖÆÈÕÖ¾£º -log-bin
ÔÚmysqlµÄ°²×°Ä¿Â¼Ï£¬´ò¿ªmy.ini,ÔÚºóÃæ¼ÓÉÏÉÏÃæµÄ²ÎÊý£¬±£´æºóÖØÆômysql·þÎñ¾ÍÐÐÁË¡£
ÀýÈ磺
#Enter a name for the error log file. Otherwise a default name will be used.
log-error=err.log
#Enter a name for the query log file. Otherwise a default name will be used.
#log=
#Enter a name for the slow query log file. Otherwise a default name will be used.
#log-slow-queries=
#Enter a name for the update log file. Otherwise a default name will be used.
#log-update=
#Enter a name for the binary log. Otherwise a default name will be used.
#log-bin=
ÉÏÃæÖ»¿ªÆôÁË´íÎóÈÕÖ¾£¬Òª¿ªÆäËûµÄÈÕÖ¾¾Í°ÑÇ°ÃæµÄ“#”È¥µô¡£
long_query_time =1 --ÊÇÖ¸Ö´Ðг¬¹ý¶à¾ÃµÄsql»á±»logÏÂÀ´£¬ÕâÀïÊÇ1Ãë
log-slow-queries=slowqueris.log --½«²éѯ·µ»Ø½ÏÂýµÄÓï¾ä½øÐмǼ
log-queries-not-using-indexes = nouseindex.log --¾ÍÊÇ×ÖÃæÒâ˼£¬logÏÂÀ´Ã»ÓÐʹÓÃË÷ÒýµÄquery
log=mylog.log --¶ÔËùÓÐÖ´ÐÐÓï¾ä½øÐмǼ
log-error=log-error.log
log=log-query.log
log-queries-not-using-indexes
log-warnings=2
log-slow-queries=log-slow-query.log
log-update=log-update.log
long_qu
Ïà¹ØÎĵµ£º
1 MySQLÖ§³Öenum,ºÍsetÀàÐÍ£¬SQL Server²»Ö§³Ö
¡¡¡¡2 MySQL²»Ö§³Önchar,nvarchar,ntextÀàÐÍ
¡¡¡¡3 MySQLµÄµÝÔöÓï¾äÊÇAUTO_INCREMENT£¬¶øMS SQLÊÇidentity(1,1)
¡¡¡¡4 MS SQLĬÈϵ½´¦±í´´½¨Óï¾äµÄĬÈÏÖµ±íʾÊÇ((0)),¶øÔÚMySQLÀïÃæÊDz»ÔÊÐí´øÁ½À¨ºÅµÄ
¡¡¡¡5 MySQLÐèҪΪ±íÖ¸¶¨´æ´¢ÀàÐÍ
¡ ......
¸ÅÊö£º
1.ÂÒÂëÎÊÌâ¹é¸ùµ½µ×ÊÇ×Ö·û¼¯µÄÎÊÌâ,ÄǾʹÓ×Ö·û¼¯ÉèÖ÷½Ã濼ÂÇ,²»ÍâºõÏÂÃ漸·½Ã棺
server(Mysql·þÎñÆ÷),client,database(Êý¾Ý¿â),connection(Á¬½Ó),result
MySQLµÄ×Ö·û¼¯´¦ÀíÊÇÕâÑùµÄ£º
£¨1£©·¢ËÍÇëÇó
¿Í»§¶Ë(character_set_client£©=¡·Êý¾ ......
·½·¨Ò»£º
1.µ¼³öÕû¸öÊý¾Ý¿â
ÃüÁîÐнøÈëµ½mysql°²×°Ä¿Â¼µÄbinĿ¼ÏÂ
¼ÙÉè×°ÔÚD:/mysql/bin
¼´£º¿ªÊ¼ ÔËÐÐ ÊäÈëcmd
d:
cd mysql/bin
È»ºóÖ´ÐÐÏÂÃæÓï¾ä
mysqldump -u Óû§Ãû -p Êý¾Ý¿âÃû > µ¼³öµÄÎļþÃû
ʾÀý£ºmysqldump -u root -p sq_wcnc > d:\wcnc.sql
2.»Ö¸´Êý¾Ý¿â
³£ÓÃsource ÃüÁî ......
Òª°²裝 MySQL£¬¿ÉÒÔÔÚ終¶ËÌáʾ·ûºó運ÐÐÏÂÁÐÃüÁ
sudo apt-get install mysql-server
sudo apt-get install mysql-client
sudo apt-get install php5-mysql
// °²×°php5-mysql Êǽ«phpºÍmysqlÁ¬½ÓÆðÀ´
Ò»µ©°²裝Íê³É£¬MySQL ·þ務Æ÷應該×Ô動啟動¡£Äú¿ÉÒÔ ......