MySQL Ô¶³ÌÁ¬½Ó
ÎÊÌ⣺Զ³ÌÁ¬½Ó·þÎñÆ÷µÄÊý¾Ý¿â
$ mysql -hserverip -uuser -ppassword
ERROR 1045 (28000): Access denied for user 'user'@'localhost'
(using password: YES)
ÔÒò£ºmysql.user±íÖÐûÓÐÉèÖÃÔ¶³ÌÁ¬½Ó
$ mysql -uroot -ppassword #ÓÃrootÓû§ÔÚserverÉϵǼ
mysql> select host, user, password from mysql.user; #²é¿´mysqlÊý¾Ý¿âuser±íÖеÄÐÅÏ¢
»á·¢ÏÖûÓÐÔ¶³Ì»úÆ÷µÄhost, µ±È»Ò²Ã»ÓÐuser
½â¾ö·½·¨£º
mysql> grant select, update, insert, delete on *.* to user@clientip identified by "password";
ÕâÑùÔÚÔ¶³Ì¿Í»§¶Ëclientip¾Í¿ÉÒÔ·ÃÎÊÊý¾Ý¿âÁË
$ mysql -hserverip -uuser -ppassword
¸½¼Ó£º
Èç¹ûÏëÈÃËùÓеÄÔ¶³Ì»úÆ÷¶¼¿ÉÒÔÓÃuserÓû§·ÃÎÊÊý¾Ý¿â¿ÉÒÔÔÚ·þÎñÆ÷Êý¾Ý¿âÖÐ×öÈçÏÂÉèÖÃ
mysql> grant all on *.* to user@"%" identified by "password";
Ïà¹ØÎĵµ£º
START TRANSACTION, COMMITºÍROLLBACKÓï·¨
START TRANSACTION | BEGIN [WORK]
COMMIT [WORK] [AND [NO] CHAIN] [[NO] RELEASE]
ROLLBACK [WORK] [AND [NO] CHAIN] [[NO] RELEASE]
SET AUTOCOMMIT = {0 | 1}
START
TRANSACTION»òBEGINÓï¾ä¿ÉÒÔ¿ªÊ¼Ò»ÏîеÄÊÂÎñ¡£COMMIT¿ÉÒÔÌá½»µ±Ç°ÊÂÎñ£¬ÊDZä¸ü³ÉΪÓÀ¾Ã±ä¸ü¡£ROLLBACK ......
ÓеÄÓû§£¬³öÓÚʹÓÃmysqlÊý¾Ý¿â¿ª·¢ÆäËû³ÌÐòµÄÐèÒª£¬¿ÉÄÜÏ£ÍûÐÞ¸ÄMysqlÊý¾Ý¿âµÄrootÓû§ÃÜÂ룬
ÏÖ×öÒÔϼòҪ˵Ã÷¡£
ÓÉÓÚOAʹÓõÄMysqlÊý¾Ý¿â±»É趨ΪֻÄÜ´Ó±¾»ú·ÃÎÊ£¬ËùÒÔÆÕͨÓû§²»½¨ÒéÐÞ¸ÄÊý¾Ý¿âÃÜÂ룬
ÐÞ¸ÄÊý¾Ý¿âÃÜÂë²¢²»ÊÇΪÁ˸ÄÉÆÏµÍ³°²È«ÐÔµÄÄ¿µÄ¡£
windows-¡µ¿ªÊ¼—¡µÔËÐУ¬ÊäÈëcmd½øÈëÃüÁîÐÐģʽ£¬²¢Ê¹Ó ......
¸ÅÊö£º
1.ÂÒÂëÎÊÌâ¹é¸ùµ½µ×ÊÇ×Ö·û¼¯µÄÎÊÌâ,ÄǾʹÓ×Ö·û¼¯ÉèÖ÷½Ã濼ÂÇ,²»ÍâºõÏÂÃæ¼¸·½Ã棺
server(Mysql·þÎñÆ÷),client,database(Êý¾Ý¿â),connection(Á¬½Ó),result
MySQLµÄ×Ö·û¼¯´¦ÀíÊÇÕâÑùµÄ£º
£¨1£©·¢ËÍÇëÇó
¿Í»§¶Ë(character_set_client£©=¡·Êý¾ ......
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Óï¾ä´æÔÚ×¢Èë©¶´µÄд·¨
±¾ÎÄ×÷Õߣºangel
ÎÄÕÂÐÔÖÊ£ºÔ´´
·¢²¼ÈÕÆÚ£º2004-09-16
±¾ÎÄÒѾ·¢±íÔÚ¡¶ºÚ¿Í·ÀÏß¡·7Ô¿¯£¬×ªÔØÇë×¢Ã÷¡£ÓÉÓÚдÁ˺ܾã¬Ëæ×ż¼ÊõµÄ½ø²½£¬±¾ÈËÒ²·¢ÏÖ¸ÃÎÄÀïÓв»ÉÙ´íÎóºÍÂÞàµĵط½¡£Çë¸÷λ¸ßÊÖ¿´Á˲»ÒªÐ¦¡£±¾ÎÄдÓÚ¡¶Advanced SQL Injection with MySQL¡·Ö®Ç°Ò»¸ ......