ÔÚMySqlÖÐÌí¼ÓÔ¶³Ì³¬¼¶Óû§
1. ʹÓÃGRANTÓï¾äÌí¼Ó£ºÊ×ÏÈÔÚÊý¾Ý¿â±¾»úÉÏÓÃROOTÓû§
µÇ¼MySql£¨ÎÒÊÇÓÃÔ¶³Ì¿ØÖÆlinux·þÎñÆ÷£¬Ï൱ÓÚÔÚ·þÎñÆ÷±¾»úµÇ¼MySqlÁË£©£¬È»ºóÊäÈ룺
mysql>GRANT ALL PRIVILEGES ON *.* TO admin@localhost IDENTIFIED BY 'something' WITH GRANT OPTION;
Ìí¼ÓÒ»¸öÓû§admin²¢ÊÚȨͨ¹ý±¾µØ»ú£¨localhost)·ÃÎÊ£¬ÃÜÂë“something”¡£
mysql>GRANT ALL PRIVILEGES ON *.* TO admin@"%" IDENTIFIED BY 'something' WITH GRANT OPTION;
Ìí¼ÓÒ»¸öÓû§admin²¢ÊÚȨ¿É´ÓÈκÎÆäËüÖ÷»ú·¢ÆðµÄ·ÃÎÊ£¨Í¨Åä·û£¥£©¡£Ê¹ÓÃÕâÒ»ÌõÓï¾ä¼´¿É¡£
2£®Ê¹ÓÃINSERTÓï¾ä£º
mysql>INSERT INTO user VALUES('%','admin',PASSWORD('something'), 'Y','Y','Y','Y','Y','Y',
'Y','Y','Y','Y','Y','Y','Y','Y')
Óû§ÐÅÏ¢¿ÉÔÚmysqlÊý¾Ý¿âÖеÄusers±íÖв鿴£¬ÕâÀï²»ÔÚ½éÉÜÁ˾͡£ÊýÇåYµÄ¸öÊýŶ¡£
Ïà¹ØÎĵµ£º
select id from message where author_id in (select followed_id from Relation where follower_id=1) order by id desc ºÍ ·Ö±ðÖ´ÐÐ $userlist = select followed_id from Relation where follower_id=1 ÔÙ select id from message where author_id in ($userlist) order by id desc ¾¹È»ÓÐÁ½¸öÊýÁ ......
2009Äê10ÔÂ30ÈÕ ÐÇÆÚÎå 22:53
1, ²é¿´MySQL
·þÎñÆ÷ÅäÖÃÐÅÏ¢
mysql> show variables;
mysql> show variables;
2, ²é¿´MySQL·þÎñÆ÷ÔËÐеĸ÷ÖÖ״ֵ̬
mysql> show global status;
mysql> show global status;
3, Âý²éѯ
mysql> show variables like '%slow%';
+--------------- ......
2009Äê10ÔÂ30ÈÕ ÐÇÆÚÎå 22:53
ÓÃmysql
ÄÚÖú¯Êýת»»ipµØÖ·ºÍÊý×Ö
ÀûÓÃÁ½¸öÄÚÖú¯Êý
inet_aton:½«ipµØַת»»³ÉÊý×ÖÐÍ
inet_ntoa:½«Êý×ÖÐÍת»»³ÉipµØÖ·
³ä·ÖÀûÓÃmysqlÄÚÖõÄ
format
º¯Êý
ÓÈÆäÊÇÔÚ´¦Àí×Ö·û¸ñʽµÄʱºò,ÀýÈ罫12345ת»»³É12,345ÕâÑùµÄ,Ö»ÒªÓÃ:format(12345,0)¼´¿É,Èç¹ûÓÃformat(12345,2)ÔòÏÔÊ ......
MySQL 5.1 ÖУ¬ÔÚ¸´ÖÆ·½ÃæµÄ¸Ä½ø¾ÍÊÇÒý½øÁËеĸ´ÖƼ¼Êõ£º»ùÓÚÐеĸ´ÖÆ¡£
MYSQL¸´ÖƵļ¸ÖÖģʽ
MySQL 5.1 ÖУ¬ÔÚ¸´ÖÆ·½ÃæµÄ¸Ä½ø¾ÍÊÇÒý½øÁËеĸ´ÖƼ¼Êõ£º»ùÓÚÐеĸ´ÖÆ¡£
¼òÑÔÖ®£¬ÕâÖÖм¼Êõ¾ÍÊǹØ×¢±íÖз¢Éú±ä»¯µÄ¼Ç¼£¬¶ø·ÇÒÔÇ°µÄÕÕ³ binlog ģʽ¡£
´Ó MySQL 5.1.12 ¿ªÊ¼£¬¿ÉÒÔÓÃÒÔÏÂÈýÖÖģʽÀ´ÊµÏÖ£º
-- »ùÓÚ ......