Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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-noinstall-5.1.30-win32.zip
2¡¢ÔÚ F Å̽¨Á¢Ä¿Â¼ MySql\MySqlServer5.1\
3¡¢°Ñ½âѹµÄÄÚÈݸ´ÖƵ½  F:\MySql\MySqlServer5.1\
4¡¢ÔÚ F:\MySql\MySqlServer5.1\ ÖÐÕÒ my-large.ini °ÑËü¸´ÖÆ³É my.ini
5¡¢ÔÚ my.ini ÖÐÕÒ [mysqld] £¬Ìí¼ÓÒÔÏÂÓï¾ä;
basedir="F:/MySql/MySqlServer5.1/"
datadir="F:/My ......

mysql ³£ÓÃÃüÁî

MySQL ÃüÁîÐÐ
µÚÒ»ÕС¢mysql·þÎñµÄÆô¶¯ºÍÍ£Ö¹
net stop mysql
net start mysql
µÚ¶þÕС¢µÇ½mysql
Óï·¨ÈçÏ£º mysql -uÓû§Ãû -pÓû§ÃÜÂë
¼üÈëÃüÁîmysql -uroot -p£¬ »Ø³µºóÌáʾÄãÊäÈëÃÜÂ룬ÊäÈë12345£¬È»ºó»Ø³µ¼´¿É½øÈëµ½mysqlÖÐÁË£¬mysqlµÄÌáʾ·ûÊÇ£º
mysql>
×¢Ò⣬Èç¹ûÊÇÁ¬½Óµ½ÁíÍâµÄ»úÆ÷ÉÏ£¬ÔòÐèÒª¼ÓÈëÒ»¸ö² ......

MySQL×Ö·û¼¯µÄÉèÖÃ

¡¾Ç°Ìá¡¿
winxpsp3
mysql5.1
¡¾²½Öè¡¿
1.½øÈëMySQL Command Line Client;
2.ÃüÁ
mysql> show variables like 'character%';
+--------------------------+---------------------------------------------------------+
| Variable_name            | ......

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; ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ