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

ÔÚC#.net³ÌÐòÖÐʹÓÃMYSQLÊý¾Ý¿â

ÏÂÃæÊÇcommond:
MySQLCommand cmd;
cmd = new MySQLDriverCS.MySQLCommand("DROP TABLE IF EXISTS test.mysqldrivercs_test",conn);
cmd.ExecuteNonQuery();
cmd.Dispose();
ÏÂÃæÊÇinsert:
string Value = "Value";
int SettingID = 1;
new MySQLInsertCommand(conn,
new object[,] {{"SettingID",SettingID},{"SettingValue",Value}},
"mysqldrivercs_test");
ÏÂÃæÊÇupdate
Value = "Value2";
new MySQLUpdateCommand(conn,
new object[,] {{"SettingValue",Value}},
"mysqldrivercs_test",
new object[,] {{"SettingID","=",SettingID}},
null);
ÏÂÃæÊÇselect
DataTable dt = new MySQLSelectCommand(conn,
new string[] {"SettingID","SettingValue"},
new string[] {"mysqldrivercs_test"},
new object[,] {{"SettingID","=",SettingID}},
null,
null
).Table;
string storedValue = dt.Rows[0]["SettingValue"].ToString();
ÏÂÃæÊÇdelete
new MySQLDeleteCommand(conn,"mysqldrivercs_test",new object[,] {{"SettingID","=",SettingID}},null);
¹Ø±ÕÁ´½Ó:
conn.Close();


Ïà¹ØÎĵµ£º

ÅжÏMySQLÁ¬½ÓÊÇ·ñÓÐЧ

²Î¼û¹Ù·½²Î¿¼£¬µÚ25Õ£ºAPIºÍ¿â
25.2.3.49. mysql_ping()
int
mysql_ping(MYSQL *mysql)


ÃèÊö
¼ì²éÓë·þÎñÆ÷µÄÁ¬½ÓÊÇ·ñ¹¤×÷¡£Èç¹ûÁ¬½Ó¶ªÊ§£¬½«×Ô¶¯³¢ÊÔÔÙÁ¬½Ó¡£
¸Ãº¯Êý¿É±»ÏÐÖÃÁ˽ϳ¤Ê±¼äµÄ¿Í»§¶ËʹÓã¬ÓÃÒÔ¼ì²é·þÎñÆ÷ÊÇ·ñÒѹرÕÁËÁ¬½Ó£¬²¢ÔÚ±ØҪʱÔÙ´ÎÁ¬½Ó¡£
·µ»ØÖµ
Èç¹ûÓë·þÎñÆ÷µÄÁ¬½ÓÓÐЧ·µ»Ø ......

mysql »ù±¾ÃüÁî

1¡¢µÇ½MySQL:
mysql -u root -p
2¡¢²é¿´Óû§ÐÅÏ¢
select user,host,password from mysql.user;
select user,host from mysql.user;
3¡¢ÉèÖÃÃÜÂë
set password for root@localhost=password('
ÔÚÕâÀïÌîÈërootÃÜÂë
');
4¡¢ÐÞ¸ÄÃÜÂë
·½·¨1£ºmysqladmin -u root -p password newpassword
·½·¨2£º ££mysql -u root ......

mysqlË÷ÒýµÄʹÓü°Óï¾äÓÅ»¯

Ò»:mysqlÀïÄ¿Ç°Ö»Ö§³Ö4ÖÖË÷Òý·Ö±ðÊÇ:b-tree,full-text,hashÒÔ¼°r-treeË÷Òý b-treeË÷ÒýÓ¦¸ÃÊÇmysqlÀï×î¹ã·ºµÄË÷ÒýµÄÁË,³ýÁËarchive,»ù±¾ËùÓеĴ洢ÒýÇ涼֧³ÖËü. 1.b-treeÔÚmyisamÀïµÄÐÎʽºÍinnodbÉÔÓв»Í¬ ÔÚinnodbÀïÃæÓÐÁ½ÖÖÐÎ̬:ÆäÒ»ÊÇprimary keyÐÎ̬Æäleaf nodeÀï´æ·ÅµÄÊÇÊý¾Ý.¶øÇÒ²»½ö´æ·ÅÁËË÷Òý¼üµÄÊý¾Ý,»¹´æ·ÅÁËÆ ......

mysql connect by c++

#include <stdio.h>
#include <windows.h>
#include <mysql.h>
#define host "localhost"
#define username "root"
#define password "123"
#define database "oa"
MYSQL *conn;
int main()
{
MYSQL_RES *res_set;
MYSQL_ROW row;
unsigned int i,ret;
FILE *fp;
MYSQL_FIELD *field; ......

mysql ÀàÐÍת»»º¯Êý

12.8.   Castº¯ÊýºÍ²Ù×÷·û  
BINARY    
BINARY²Ù×÷·û½«ºóÃæµÄ×Ö·û´®Å׸øÒ»¸ö¶þ½øÖÆ×Ö·û´®¡£ÕâÊÇÒ»ÖÖ¼òµ¥µÄ·½Ê½À´´ÙʹÖð×Ö½Ú¶ø²»ÊÇÖð×Ö·ûµÄ½øÐÐÁбȽϡ£ÕâʹµÃ±È½ÏÇø·Ö´óСд£¬¼´Ê¹¸ÃÁв»±»¶¨ÒåΪ   BINARY»ò   BLOB¡£BINARYÒ²»á²úÉú½áβ¿Õ°×£¬´Ó¶ø¸ü¼ÓÏÔ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ