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

vs2005Á¬½ÓmysqlÊý¾Ý¿â

Vs2005Á¬½ÓmysqlÊý¾Ý¿â
Ò»¡¢ÏÂÔØÖ§³ÖmysqlµÄ΢ÈíµÄͨÓÃÀàmysql-connector-net-1.0.7-noinstall.zip
¶þ¡¢ÏÂÔØµØÖ·http://www.cnblogs.com/eugenewu0808/archive/2006/10/11/mysqldata.html
Èý¡¢½âѹÎļþ
ËÄ¡¢Ìí¼ÓÒýÓÃÕÒµ½binÎļþ¼ÐÕÒµ½net-2.0 vs2005µÄ£¨ºÍvsÏàÓ¦°æ±¾µÄ£©ÕÒµ½MySql.Data.dll
Îå¡¢ÔÚÀàÖÐÒýÓÃusing MySql.Data.MySqlClient;µÄÃüÃû¿Õ¼ä
Áù¡¢¾ßÌåÁ¬½Ó£º
1. Á¬½Ó×Ö·û´®1
string connStr = String.Format("server={0};user id={1}; password={2}; database={3}; pooling=false;port=3306", "127.0.0.1", "test", "test", "test");
2. Á¬½Ó×Ö·û´®2
string connecStr=“Database='testdb';Data Source='localhost';User Id='db';Password='apple';charset='utf8'”
3.Ó¦ÓÃ
 MySqlConnection myConn = new MySqlConnection(connStr);
           myConn.Open();
           MySqlCommand cmd = myConn.CreateCommand();


Ïà¹ØÎĵµ£º

CentOSÏÂÎÞ·¨Õý³£»ñÈ¡MySQLÊý¾Ý¿â±íÊý¾ÝµÄÎÊÌâ

 
֮ǰ£¬ÓÉÓÚ¿Í»§ÒªÇóÔÚcentOSϰ²×°ÏµÍ³Ó¦Óã¬Òò´ËÓлú»á½Ó´¥ÁËÒ»ÏÂCentOS£¬Ë³±ãÒ²Á˽âÁËÏÂCentOSµÄ³£¹æ²Ù×÷£¬»¹ÓÐÔÚCentOSϵÄMySQLÏà¹Ø²Ù×÷¡£
Ŀǰ¼¼Êõ¿ò¼ÜʹÓÃJSF£¨richfaces¡¢facelets£©+Spring+JPA£¨OpenJPA£©£¬²»Ê¹ÓÃÊý¾Ý¿âÒÀÀµµÄ´¥·¢Æ÷»ò´æ´¢¹ý³Ì£¬ËùÓÐÒµÎñÂß¼­ÔÚweb·þÎñÆ÷ÉÏÖ´ÐУ¬Òò´ËÊý¾Ý¿â»ù±¾²»Óÿ¼ÂÇÒÆ ......

MYSQl left joinÁªºÏ²éѯЧÂÊ·ÖÎö

user±í:
id | name
———
1 | libk
2 | zyfon
3 | daodao
user_action±í:
user_id | action
—————
1 | jump
1 | kick
1 | jump
2 | run
4 | swim
sql:
select id, name, action from user as u
left join user_action a on u.id = a.user_id
result:
id | ......

ÎÞ·¨ÔØÈë mysql À©Õ¹£¬Çë¼ì²é PHP ÅäÖá­¡­½â¾ö°ì·¨

PS:ÎÒ½ñÌìÅäÖà ·þÎñÆ÷µÄʱºò³öÏÖµÄÎÊÌâ¾ÍÊÇÕâ¸ö£¬µ«ÊÇÕÕ×Å·½·¨¶¼×öÁË£¬Ñ¾µÄ¡£¡£»¹ÊÇûÓ㬼«¶ÈÓôÃÆËÀ¡£¡£°¥¡£¡£¡£ÎÒÒ²²»ÖªµÀʲôԭÒòÄØ¡£¡£¿ÉÄܵÄÔ­Òò¶¼ÕÒ¹ýÁË¡£¡£ÓôÃÆ°¡`~
apache2+mysql+php5+phpmyadminÅäÖÃÎÊÌ⣺ÎÞ·¨¼ÓÈëmysqlÀ©Õ¹£¬Çë¼ì²éphpÅäÖÃ...
°²×°Íêapache2+mysql+php5ºó£¬°²×°phpmyadmin²¢ÅäÖúÃÒÔºó£¬ÔÚä¯À ......

ÈçºÎ±¸·ÝMysqlÊý¾Ý¿â

 
mysqldump -u[user] -p[password] [databasename] > [dump_name]
ÔÚ½« dump_name Õâ¸öµµ°¸¸´ÖƵ½Áíһ̨¼ÆËã»úÉÏ
Áíһ̨¼ÆËã»úÉÏÏȽøÈëmysql
½¨Á¢Ò»¸ö database ÔÙÖ´ÐÐÏÂÁÐÖ¸Áî
mysql -u[user] -p[password] [database_name] < [dump_name]


MYSQL¼¸ÖÖ±¸·Ý·½·¨¸ÅÊö
MysqlÊý¾Ý
¿â±¸·ÝÖ÷ÒªÓÐ4Ö ......

ʵÀý½²½âMySQLÁªºÏ²éѯ

 ÔÚ½²MySQLµÄJoinÓ﷨ǰ»¹ÊÇÏȻعËÒ»ÏÂÁª½áµÄÓï·¨£¬ºÇºÇ£¬ÆäʵÁ¬ÎÒ×Ô¼º¶¼ÍüµÃ²î²»¶àÁË£¬ÄǾʹó¼ÒÒ»ÆðÎÂϰ°É£¨Èç¹ûÄÚÈÝÓдíÎó»òÓÐÒÉÎÊ£¬¹úÄÚ¹ØÓÚMySQLÁª½á²éѯµÄ×ÊÁÏÊ®·ÖÉÙ£¬ÏàÐÅ´ó¼ÒÔÚ¿´Á˱¾Îĺó»á¶ÔMySQLÁª½áÓï·¨ÓÐÏ൱ÇåÎúµÄÁ˽⣬Ҳ²»»á±»OracleµÄÍâÁª½áµÄ£¨“£«”ºÅ£©ÅªµÃºýÍ¿ÁË¡£
ÔÚSQL±ê×¼Öй滮µÄ£¨ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ