Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

MySQLÖÐÐÞ¸ÄÃÜÂë¼°·ÃÎÊÏÞÖÆÉèÖÃÏê½â

MySQLÊÇÒ»¸öÕæÕýµÄ¶àÓû§¡¢¶àÏß³ÌSQLÊý¾Ý¿â·þÎñÆ÷¡£MySQLÊÇÒÔÒ»¸ö¿Í»§»ú/·þÎñÆ÷½á¹¹µÄʵÏÖ£¬ËüÓÉÒ»
¸ö·þÎñÆ÷ÊØ»¤³ÌÐòmysqldºÍºÜ¶à²»Í¬µÄ¿Í»§³ÌÐòºÍ¿â×é³É¡£ÓÉÓÚÆäÔ´ÂëµÄ¿ª·ÅÐÔ¼°Îȶ¨ÐÔ£¬ÇÒÓëÍøÕ¾Á÷Ðбà徎ÓïÑÔPHPµÄÍêÃÀ½áºÏ£¬ÏÖÔںܶàÕ¾µã¶¼ÀûÓÃÆä
µ±×÷ºó¶ËÊý¾Ý¿â£¬Ê¹Æä»ñµÃÁ˹㷺ӦÓᣴ¦ÓÚ°²È«·½ÃæµÄ¿¼ÂÇ£¬ÐèҪΪÿһÓû§¸³ÓÚ¶Ô²»Í¬Êý¾Ý¿âµÄ·ÃÎÊÏÞÖÆ£¬ÒÔÂú×㲻ͬÓû§µÄÒªÇó¡£ÏÂÃæ¾Í·Ö±ðÌÖÂÛ£¬¹©´ó¼Ò²Î
¿¼¡£
Ò»¡¢MySQLÐÞ¸ÄÃÜÂë·½·¨×ܽá
Ê×ÏÈҪ˵Ã÷Ò»µãµÄÊÇ£ºÒ»°ãÇé¿öÏ£¬ÐÞ¸ÄMySQLÃÜÂëÊÇÐèÒªÓÐmysqlÀïµÄrootȨÏ޵ģ¬ÕâÑùÒ»°ãÓû§ÊÇÎÞ·¨¸ü¸ÄÃÜÂëµÄ£¬³ý·ÇÇëÇó¹ÜÀíÔ±°ïÖúÐ޸ġ£
·½·¨Ò»
ʹÓÃphpMyAdmin
(ͼÐλ¯¹ÜÀíMySqlÊý¾Ý¿âµÄ¹¤¾ß)£¬ÕâÊÇ×î¼òµ¥µÄ£¬Ö±½ÓÓÃSQLÓï¾äÐÞ¸ÄmysqlÊý¾Ý¿â¿âµÄuser±í£¬²»¹ý±ðÍüÁËʹÓÃPASSWORDº¯Êý£¬²åÈë
Óû§ÓÃInsertÃüÁÐÞ¸ÄÓû§ÓÃUpdateÃüÁɾ³ýÓÃDeleteÃüÁî¡£ÔÚ±¾½ÚºóÃæÓÐÊý¾Ý±íuser×ֶεÄÏêϸ½éÉÜ¡£
·½·¨¶þ
ʹÓÃmysqladmin¡£ÊäÈë
mysqladmin -u root -p oldpassword newpasswd
Ö´ÐÐÕâ¸öÃüÁîºó£¬ÐèÒªÊäÈërootµÄÔ­ÃÜÂ룬ÕâÑùrootµÄÃÜÂ뽫¸ÄΪnewpasswd¡£Í¬Ñù£¬°ÑÃüÁîÀïµÄ
root¸ÄΪÄãµÄÓû§Ãû£¬Äã¾Í¿ÉÒÔ¸ÄÄã×Ô¼ºµÄÃÜÂëÁË¡£ µ±È»Èç¹ûÄãµÄmysqladminÁ¬½Ó²»ÉÏmysql
server£¬»òÕßÄãûÓа취ִÐÐmysqladmin£¬ÄÇôÕâÖÖ·½·¨¾ÍÊÇÎÞЧµÄ£¬¶øÇÒmysqladminÎÞ·¨°ÑÃÜÂëÇå¿Õ¡£
ÏÂÃæµÄ·½·¨¶¼ÔÚmysqlÌáʾ·ûÏÂʹÓã¬ÇÒ±ØÐëÓÐmysqlµÄrootȨÏÞ£º
·½·¨Èý
mysql> INSERT INTO mysql.user (Host,User,Password) VALUES (\'%\',\'system\', PASSWORD(\'manager\'));
mysql> FLUSH PRIVILEGES
È·ÇеØ˵ÕâÊÇÔÚÔö¼ÓÒ»¸öÓû§£¬Óû§ÃûΪsystem£¬ÃÜÂëΪmanager¡£×¢ÒâҪʹÓÃPASSWORDº¯Êý£¬È»ºó»¹ÒªÊ¹ÓÃFLUSH PRIVILEGESÀ´Ö´ÐÐÈ·ÈÏ¡£
·½·¨ËÄ
ºÍ·½·¨ÈýÒ»Ñù£¬Ö»ÊÇʹÓÃÁËREPLACEÓï¾ä
mysql> REPLACE INTO mysql.user (Host,User,Password)
VALUES(\'%\',\'system\',PASSWORD(\'manager\'));
mysql> FLUSH PRIVILEGES
·½·¨Îå
ʹÓÃSET PASSWORDÓï¾ä
mysql> SET PASSWORD FOR system@\"%\" = PASSWORD(\'manager\');
ÄãÒ²±ØÐëʹÓÃPASSWORD()º¯Êý£¬µ«ÊDz»ÐèҪʹÓÃFLUSH PRIVILEGESÀ´Ö´ÐÐÈ·ÈÏ¡£
·½·¨Áù
ʹÓÃGRANT ... IDENTIFIED BYÓï¾ä£¬À´½øÐÐÊÚȨ¡£
mysql> GRANT USAGE ON *.* TO system@\"%\" IDENTIFIED BY \'manager\';
ÕâÀïPASSWORD()º¯ÊýÊDz»±ØÒªµÄ£¬Ò²²»ÐèҪʹÓÃFLUSH PRIVI


Ïà¹ØÎĵµ£º

ÐÞ¸Äͨ´ïOA MysqlÊý¾Ý¿âÃÜÂë


ÓеÄÓû§£¬³öÓÚʹÓÃmysqlÊý¾Ý¿â¿ª·¢ÆäËû³ÌÐòµÄÐèÒª£¬¿ÉÄÜÏ£ÍûÐÞ¸ÄMysqlÊý¾Ý¿âµÄrootÓû§ÃÜÂ룬
ÏÖ×öÒÔϼòҪ˵Ã÷¡£
ÓÉÓÚOAʹÓõÄMysqlÊý¾Ý¿â±»É趨ΪֻÄÜ´Ó±¾»ú·ÃÎÊ£¬ËùÒÔÆÕͨÓû§²»½¨ÒéÐÞ¸ÄÊý¾Ý¿âÃÜÂ룬
ÐÞ¸ÄÊý¾Ý¿âÃÜÂë²¢²»ÊÇΪÁ˸ÄÉÆϵͳ°²È«ÐÔµÄÄ¿µÄ¡£
windows-¡µ¿ªÊ¼—¡µÔËÐУ¬ÊäÈëcmd½øÈëÃüÁîÐÐģʽ£¬²¢Ê¹Ó ......

JDBC+MySQLÁ¬½Ó³Ø

1.´´½¨Ò»¸öjava projectÏîÄ¿pooling
2.ΪÏîÄ¿Ìí¼ÓMySQLÁ¬½ÓÇý¶¯
3.ΪÏîÄ¿Ìí¼ÓÒ»¸öÅäÖÃÎļþdbpool.proprerties
Code
driverClassName=com.mysql.jdbc.Driver
username=root
password=
url=jdbc:mysql://localhost:3306/work
poolSize=10
 
4.·Ö±ð´´½¨Ò»¸öÁ¬½ÓÀàConnectionPool.javaºÍÒ»¸ö²âÊÔÀàConnectionPoo ......

MySQLÊý¾Ý¿â±¸·ÝÓë»Ö¸´

·½·¨Ò»£º
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 ÃüÁî ......

Backup and Restore MySQL Database Using mysqldump


Backup and Restore MySQL Database Using mysqldump
by Ramesh Natarajan on September 22, 2008ShareThis
[mysqldump - MySQL Backup & Restore]mysqldump is an effective tool to backup MySQL database. It creates a *.sql file with DROP table, CREATE table and INSERT into sql-statements of the source ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ