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 ......
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£¬¿ÉÒÔÔÚ終¶ËÌáʾ·ûºó運ÐÐÏÂÁÐÃüÁ
sudo apt-get install mysql-server
sudo apt-get install mysql-client
sudo apt-get install php5-mysql
// °²×°php5-mysql Êǽ«phpºÍmysqlÁ¬½ÓÆðÀ´
Ò»µ©°²裝Íê³É£¬MySQL ·þ務Æ÷應該×Ô動啟動¡£Äú¿ÉÒÔ ......
conn.php
<?php
/*
* Created on 2010-1-6
* Author:CHAUVET
* Function:Á¬½Ó×Ö·û´®
*/
$conn=@mysql_connect("localhost","root","")or die("Á¬½ÓÊý¾Ý¿â³ö´í£¡");
mysql_select_db("newdb",$conn);
mysql_query("set names 'gb2312'");
function ReplaceSom ......
mysqlϵļÓÃܺ¯ÊýÓÐÈçϼ¸¸ö
PASSWORD()£º´´½¨Ò»¸ö¾¹ý¼ÓÃܵÄÃÜÂë×Ö·û´®£¬ÊʺÏÓÚ²åÈëµ½MySQLµÄ°²È«Ïµ
ͳ¡£¸Ã¼ÓÃܹý³Ì²»¿ÉÄæ£¬ºÍunixÃÜÂë¼ÓÃܹý³ÌʹÓò»Í¬µÄËã·¨¡£Ö÷ÒªÓÃÓÚMySQLµÄÈÏ֤ϵͳ¡£
ENCRYPT(£¬)£ºÊ¹ÓÃUNIX crypt()ϵͳ¼ÓÃÜ×Ö·û´®£¬ENCRYPT()º¯Êý½ÓÊÕÒª¼ÓÃܵÄ×Ö·û´®ºÍ£¨¿ÉÑ¡µÄ£©ÓÃÓÚ¼ÓÃܹý³ÌµÄsalt£¨Ò»¸ ......