Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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ÖеÄTimestampÀàÐÍ×ֶεÄʹÓÃ

TIMESTAMPÁÐÀàÐÍÌṩһÖÖÀàÐÍ£¬Äã¿ÉÒÔʹÓÃËü×Ô¶¯µØÓõ±Ç°µÄÈÕÆÚºÍʱ¼ä±ê¼ÇINSERT»òUPDATEµÄ²Ù×÷¡£Èç¹ûÄãÓжà¸öTIMESTAMPÁУ¬Ö»ÓеÚÒ»¸ö×Ô¶¯¸üС£
  ×Ô¶¯¸üеÚÒ»¸öTIMESTAMPÁÐÔÚÏÂÁÐÈκÎÌõ¼þÏ·¢Éú£º
ÁÐûÓÐÃ÷È·µØÔÚÒ»¸öINSERT»òLOAD   DATA   INFILEÓï¾äÖÐÖ¸¶¨¡£     
ÁÐûÓÐÃ÷È·µØÔÚÒ ......

MySQL ´æ´¢ÒýÇæInnoDB/MYISAM

Ò»¡¢MYSQL´æ´¢ÒýÇæ´óÈ«£º
·MyISAM£ºÄ¬ÈϵÄMySQL²å¼þʽ´æ´¢ÒýÇ棬ËüÊÇÔÚWeb¡¢Êý¾Ý²Ö´¢ºÍÆäËûÓ¦Óû·¾³ÏÂ×ʹÓõĴ洢ÒýÇæÖ®Ò»¡£×¢Ò⣬ͨ¹ý¸ü¸ÄSTORAGE_ENGINEÅäÖñäÁ¿£¬Äܹ»·½±ãµØ¸ü¸ÄMySQL·þÎñÆ÷µÄĬÈÏ´æ´¢ÒýÇæ¡£
·InnoDB£ºÓÃÓÚÊÂÎñ´¦ÀíÓ¦ÓóÌÐò£¬¾ßÓÐÖÚ¶àÌØÐÔ£¬°üÀ¨ACIDÊÂÎñÖ§³Ö¡£
·BDB£º¿ÉÌæ´úI ......

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ÖÐÈçºÎÅúÁ¿Éú³É½Å±¾


[root@sql21 ~]# mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 5.1.26-rc-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> show databases;
+--------------------+
| Database  &nb ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ