MYSQL³õѧÕßʹÓÃÖ¸ÄÏ
http://www.chinalinuxpub.com/read.php?wid=45
ÓкܶàÅóÓÑËäÈ»°²×°ºÃÁËmysqlµ«È´²»ÖªÈçºÎʹÓÃËü¡£ÔÚÕâƪÎÄÕÂÖÐÎÒÃǾʹÓÁ¬½ÓMYSQL¡¢ÐÞ¸ÄÃÜÂë¡¢Ôö¼ÓÓû§µÈ·½ÃæÀ´Ñ§Ï°Ò»Ð©MYSQLµÄ³£ÓÃÃüÁî¡£
Ò»¡¢Á¬½ÓMYSQL¡£
¸ñʽ£º mysql -hÖ÷»úµØÖ· -uÓû§Ãû £pÓû§ÃÜÂë
1¡¢Àý1£ºÁ¬½Óµ½±¾»úÉϵÄMYSQL¡£
Ê×ÏÈÔÚ´ò¿ªDOS´°¿Ú£¬È»ºó½øÈëĿ¼ mysqlbin£¬ÔÙ¼üÈëÃüÁîmysql -uroot -p£¬»Ø³µºóÌáʾÄãÊäÃÜÂ룬Èç¹û¸Õ°²×°ºÃMYSQL£¬³¬¼¶Óû§rootÊÇûÓÐÃÜÂëµÄ£¬¹ÊÖ±½Ó»Ø³µ¼´¿É½øÈëµ½MYSQLÖÐÁË£¬MYSQLµÄÌáʾ·ûÊÇ£ºmysql>
2¡¢Àý2£ºÁ¬½Óµ½Ô¶³ÌÖ÷»úÉϵÄMYSQL¡£¼ÙÉèÔ¶³ÌÖ÷»úµÄIPΪ£º110.110.110.110£¬Óû§ÃûΪroot,ÃÜÂëΪabcd123¡£Ôò¼üÈëÒÔÏÂÃüÁ
mysql -h110.110.110.110 -uroot -pabcd123
£¨×¢:uÓëroot¿ÉÒÔ²»Óüӿոñ£¬ÆäËüÒ²Ò»Ñù£©
3¡¢Í˳öMYSQLÃüÁ exit £¨»Ø³µ£©
¶þ¡¢ÐÞ¸ÄÃÜÂë¡£
¸ñʽ£ºmysqladmin -uÓû§Ãû -p¾ÉÃÜÂë password ÐÂÃÜÂë
1¡¢Àý1£º¸øroot¼Ó¸öÃÜÂëab12¡£Ê×ÏÈÔÚDOSϽøÈëĿ¼mysqlbin£¬È»ºó¼üÈëÒÔÏÂÃüÁî
mysqladmin -uroot -password ab12
×¢£ºÒòΪ¿ªÊ¼Ê±rootûÓÐÃÜÂ룬ËùÒÔ-p¾ÉÃÜÂëÒ»Ïî¾Í¿ÉÒÔÊ¡ÂÔÁË¡£
2¡¢Àý2£ºÔÙ½«rootµÄÃÜÂë¸ÄΪdjg345¡£
mysqladmin -uroot -pab12 password djg345
Èý¡¢Ôö¼ÓÐÂÓû§¡££¨×¢Ò⣺ºÍÉÏÃ治ͬ£¬ÏÂÃæµÄÒòΪÊÇMYSQL»·¾³ÖеÄÃüÁËùÒÔºóÃ涼´øÒ»¸ö·ÖºÅ×÷ΪÃüÁî½áÊø·û£©
¸ñʽ£ºgrant select on Êý¾Ý¿â.* to Óû§Ãû@µÇ¼Ö÷»ú identified by "ÃÜÂë"
Àý1¡¢Ôö¼ÓÒ»¸öÓû§test1ÃÜÂëΪabc£¬ÈÃËû¿ÉÒÔÔÚÈκÎÖ÷»úÉϵǼ£¬²¢¶ÔËùÓÐÊý¾Ý¿âÓвéѯ¡¢²åÈë¡¢Ð޸ġ¢É¾³ýµÄȨÏÞ¡£Ê×ÏÈÓÃÒÔrootÓû§Á¬ÈëMYSQL£¬È»ºó¼üÈëÒÔÏÂÃüÁ
grant select,insert,update,delete on *.* to test1@"%" Identified by "abc";
µ«Àý1Ôö¼ÓµÄÓû§ÊÇÊ®·ÖΣÏյģ¬ÄãÏëÈçij¸öÈËÖªµÀtest1µÄÃÜÂ룬ÄÇôËû¾Í¿ÉÒÔÔÚinternetÉϵÄÈκÎһ̨µçÄÔÉϵǼÄãµÄmysqlÊý¾Ý¿â²¢¶ÔÄãµÄÊý¾Ý¿ÉÒÔΪËùÓûΪÁË£¬½â¾ö°ì·¨¼ûÀý2¡£
Àý2¡¢Ôö¼ÓÒ»¸öÓû§test2ÃÜÂëΪabc,ÈÃËûÖ»¿ÉÒÔÔÚlocalhostÉϵǼ£¬²¢¿ÉÒÔ¶ÔÊý¾Ý¿âmydb½øÐвéѯ¡¢²åÈë¡¢Ð޸ġ¢É¾³ýµÄ²Ù×÷£¨localhostÖ¸±¾µØÖ÷»ú£¬¼´MYSQLÊý¾Ý¿âËùÔÚµÄÄÇ̨Ö÷»ú£©£¬ÕâÑùÓû§¼´Ê¹ÓÃÖªµÀtest2µÄÃÜÂ룬ËûÒ²ÎÞ·¨´ÓinternetÉÏÖ±½Ó·ÃÎÊÊý¾Ý¿â£¬Ö»ÄÜͨ¹ýMYSQLÖ÷»úÉϵÄwebÒ³À´·ÃÎÊÁË¡£
grant select,insert,update,delete on mydb.* to test2@localhost identified by "abc";
Èç¹ûÄã²»Ïëtest2ÓÐÃÜÂ룬¿ÉÒÔÔÙ´òÒ»¸öÃüÁÃÜÂëÏûµô¡£
grant select
Ïà¹ØÎĵµ£º
mysql 5.0´æ´¢¹ý³Ìѧϰ×ܽá
mysql´æ´¢¹ý³ÌµÄ´´½¨£¬É¾³ý£¬µ÷Óü°ÆäËû³£ÓÃÃüÁî
mysql 5.0´æ´¢¹ý³Ìѧϰ×ܽá
Ò».´´½¨´æ´¢¹ý³Ì
1.»ù±¾Óï·¨£º
create procedure sp_name()
begin
………
end
2.²ÎÊý´«µÝ
¶þ.µ÷Óô洢¹ý³Ì
1.»ù±¾Óï·¨£ºcall sp_name()
×¢Ò⣺´æ´¢¹ý³ÌÃû³ÆºóÃæ±ØÐë¼ÓÀ¨ºÅ£¬ÄÄŸô洢¹ ......
£¨1£©ÔÚÉè¼ÆÊý¾Ý¿â×ֶεÄʱºò£¬°ÑÐèÒª»ñÈ¡ÊÖ»úºÅµÄ×Ö¶ÎÉèÖÃΪint(11)£¬ÔÒâÊÇҪȡ11λÊýµÄ£¬½á¹û·¢ÏÖËùÓеÄÊÖ»úºÅÂ룬¶¼±ä³ÉÁË2147483647
£¬¶Ùʱ¾õµÃºÜÆæ¹Ö£¬ÒÔΪÊdzÌÐòÓÐÎÊÌ⣬×îºó·¢¾õÊÇÊý¾Ý¿âÉè¼ÆµÄÎÊÌâ¡£ÒòΪÓзûºÅÕûÊýµÄ×î´óֵΪ
2147483647£¬ËùÒÔ×îºó¾ö¶¨°ÑÊý¾Ý¿âµÄ½á¹¹±ä»¯Ï£¬°Ñint(11)±äΪchar(11)²Å¸ã¶¨¡£
£¨2 ......
[perl] ÅúÁ¿Ìø¹ýmysql slave´íÎóС½Å±¾
2009Äê02ÔÂ20ÈÕ 16:24
·¢ÏÖmysql slave·þÎñÆ÷¾³£ÒòΪһЩÌØÊâ×Ö·û»òÕß·ûºÅ²úÉúµÄ¸üÐÂÓï¾ä±¨´í£¬Õû¸öͬ²½Ò²»áÒò´Ë¶ø¿¨ÔÚÄÇ£¬×î³õµÄ°ì·¨Ö»ÊÇÊÖ¶¯È¥³ö´íµÄ»úÆ÷£¬Ö´ÐÐÏÂÃæÈýÌõsqlÓï¾ä£¬Ìø¹ý´íÎó¼´¿É¡£
slave stop;
set GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
slave start;
һ̨slave»ú ......
1. ¿ªÊ¼->¿ØÖÆÃæ°å->Ìí¼Ó»òɾ³ý³ÌÐò->жÔØmysql
2. ¼ÙÉè֮ǰmysqlµÄ°²×°Ä¿Â¼ÊÇC:\Program Files\MySQL\MySQL Server 5.1/, ÄÇôÕâ¸öÏÂÃ滹±£ÁôÁËһЩ¶«Î÷£¬´ò¿ªmy.ini
3. ÕÒµ½#Path to the database root£¬ È»ºó°´ÕÕÕâ¸öPathÕÒµ½mysql,ɾµô
4. °ÑC:\Program Files\MySQLҲɾµô
5. ¿ªÊ¼->ÔËÐÐ ÊäÈër ......
DOS¡¡´°¿Ú
¿ªÊ¼££¾ÔËÐУ£¾¡¡cmd
µ¼³öΪ£º¡¡mysqldump -u Óû§Ãû -p --opt Êý¾Ý¿âÓû§Ãû >
Êý¾Ý¿âÃû.sql
ÊäÈëÄãµÄÊý¾Ý¿âÃÜÂë!phpma.com
µ¼ÈëΪ£ºmysql -u Óû§Ãû -p Êý¾Ý¿âÓû§Ãû < Êý¾Ý¿âÃû.sql
£¨Òª
ÔÚµ±Ç°Ä¿Â¼Ï²Ù×÷£©
ÒªÏ뽫Îı¾Îļþ
“
pet.txt
”
×°Ôص½
pet
±íÖУ¬Ê¹Ó ......