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

ʹÓÃC²Ù×÷MySQLÊý¾Ý¿â£¨vs 2008£©

×î½ü¼¸ÌìÏÐÀ´ÎÞÊ£¬±ã³¢ÊÔÁËÒ»ÏÂÓÃC²Ù×÷Êý¾Ý¿â£¬ÏÂÃæ±ãÊÇÎÒ²âÊԵľßÌå½á¹û£º
¿ª·¢»·¾³ÊÇwindows 7 ultimate(Ó¢ÎÄ°æ) IDE ÊÇvs 2008 professional ÖÐÎÄ°æ,Êý¾Ý¿âÊÇmysql 5.1
Ê×ÏÈ£¬ÎÒÔÚMySQL¿âÖд´½¨ÁËÒ»¸ötest±í£º
CREATE TABLE `test` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(20) NOT NULL,
  `age` int(3) DEFAULT NULL,
  `gender` char(1) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8
È»ºó£¬ÒªÅäÖúÃvs 2008ϵĿª·¢»·¾³£º
¹¤¾ß->Ñ¡Ïî->ÏîÄ¿ºÍ½â¾ö·½°¸->vc++Ŀ¼
1. ÔÚ´°¿ÚÓÒ±ßÌí¼Ó°üº¬Îļþ£¨ÎÒµÄÊÇD:\Program Files\MySQL\MySQL Server 5.1\include£©
2.Ìí¼Ó¿âÎļþ£¨D:\Program Files\MySQL\MySQL Server 5.1\lib\opt£©
ÅäÖúú󣬼´¿É´´½¨ÐµĹ¤³ÌÁË¡£ÏÂÃæ±ãÊÇÎҵIJâÊÔ´úÂ룬עÊͱȽÏÏêϸ£¬ÎÒÕâÀï¾Í²»×ö¹ý¶àµÄ½éÉÜÁË¡£
×¢ÊÍ´ó¶àÊý¶¼ÊÇÎÒ·­ÒëÁËÓ¢ÎÄÎĵµ£¬Ó¢ÎĺõĿÉÒÔÖ±½Ó²Î¿¼MySQLµÄ¹Ù·½Îĵµ¡£
MySQL¹ÙÍø£ºwww.mysql.com
#include <iostream>
#include <windows.h>
#include <stdio.h>
#include "mysql.h"
//·Ç³£ÖØÒª
#pragma comment(lib, "libmysql.lib")
using namespace std;
int main() {
 MYSQL *mysql;
 MYSQL_RES *result;
 MYSQL_ROW row;
 unsigned int field_count;
 unsigned int num_fields;
 my_ulonglong affected_rows;
 const char* selectString = "SELECT name,age,gender from test";
 const char* updateString = "UPDATE test SET age=30 WHERE id=4";
 const char* deleteString = "DELETE from test WHERE id=4";
 const char* insertString = "INSERT INTO test VALUES(null,'zhaoliu',24,'m')";
 const char* mutilExecution = "INSERT INTO test VALUES(null,'zhaoliu',24,'m');DELETE from test WHERE id=4";
 /*
  MYSQL *mysql_init(MYSQL *mysql)
  º¯ÊýÃèÊö£º
  ·ÖÅä»ò³õʼ»¯Ò»¸öÊʺÏmysql_real_connect()º¯ÊýµÄMYSQL¶ÔÏó¡£Èç¹ûmysqlÊÇ¿ÕÖ¸Õ룬Ôòº¯Êý·ÖÅä²¢³õʼ»¯
  Ò»¸öеÄMYSQL¶ÔÏó£¬×÷Ϊ·µ»ØÖµ·µ»Ø¡£·ñÔò£¬Ö±½Ó³õʼ»¯¶ÔÏ󣬲¢·µ»Ø¶ÔÏóµÄµØÖ·¡£Èç¹ûÓÃmysql_init()º¯Êý
  ³õʼ»¯ÁËÒ»¸öеĶÔÏó£¬ÔòÔÚµ÷ÓÃmysql_clos


Ïà¹ØÎĵµ£º

mysql³£¼û´íÎóÌáʾ¼°½â¾ö·½·¨

130 £ºÎļþ¸ñʽ²»ÕýÈ·¡££¨»¹²»ÊǺÜÇå³þ´íÎóµÄ×´¿ö£©
145  £ºÎļþÎÞ·¨´ò¿ª¡£
1005£º´´½¨±íʧ°Ü¡£
1006£º´´½¨Êý¾Ý¿âʧ°Ü¡£
1007£ºÊý¾Ý¿âÒÑ´æÔÚ£¬´´½¨Êý¾Ý¿âʧ°Ü¡£
1008£ºÊý¾Ý¿â²»´æÔÚ£¬É¾³ýÊý¾Ý¿âʧ°Ü¡£
1009£º²»ÄÜɾ³ýÊý¾Ý¿âÎļþµ¼ÖÂɾ³ýÊý¾Ý¿âʧ°Ü¡£
1010£º²»ÄÜɾ³ýÊý¾ÝĿ¼µ¼ÖÂɾ³ýÊý¾Ý¿âʧ°Ü¡£
1011£ºÉ ......

C/C++ÖеĽṹÌå(struct)


ʲôÊǽṹÌ壿
¼òµ¥µÄÀ´Ëµ£¬½á¹¹Ìå¾ÍÊÇÒ»¸ö¿ÉÒÔ°üº¬²»Í¬Êý¾ÝÀàÐ͵ÄÒ»¸ö½á¹¹£¬ËüÊÇÒ»ÖÖ¿ÉÒÔ×Ô¼º¶¨ÒåµÄÊý¾ÝÀàÐÍ£¬ËüµÄÌصãºÍÊý×éÖ÷ÒªÓÐ
Á½µã²»Í¬£¬Ê×ÏȽṹÌå¿ÉÒÔ
ÔÚÒ»¸ö½á¹¹ÖÐÉùÃ÷²»Í¬µÄÊý¾ÝÀàÐÍ£¬µÚ¶þÏàͬ½á¹¹µÄ½á¹¹Ìå±äÁ¿ÊÇ¿ÉÒÔÏ໥¸³ÖµµÄ£¬¶øÊý×éÊÇ×ö²»µ½µÄ£¬ÒòΪÊý×éÊǵ¥Ò»Êý¾ÝÀàÐ͵ÄÊý¾Ý¼¯ºÏ£¬Ëü±¾Éí²»ÊÇÊý¾ÝÀàÐÍ ......

linuxÏ mysql Íü¼ÇrootÓû§ÃÜÂë½â¾ö°ì·¨

linuxÏÂÍü¼ÇÁËmysqlµÄrootÓû§ÃÜÂë½â¾ö°ì·¨£º
¡¡¡¡Ò»¡¢ÒÔϵͳµÄrootÓû§£¨Ê²Ã´£¬ÄãµÄϵͳµÄrootÓû§ÃÜÂëÒ²ÍüÁË¡£ÄÇÖ»ºÃ¿´ÎÒÁíÍâһƪlinuxÏÂÍü¼ÇrootÓû§µÄ½â¾ö°ì·¨ÁËÏȽâ¾öÕâ¸öÎÊÌ⣩µÇ½ϵͳ£¬½øÈëÖÕ¶Ë
¡¡¡¡[root@localhost /]#
¡¡¡¡¶þ¡¢É±µômysql½ø³Ì
¡¡¡¡·½·¨1¡¢[root@localhost /]#killall mysqld
¡¡¡¡·½·¨2¡ ......

MySQLѧϰ±Ê¼Ç£ºInnoDBºÍMyISAMµÄ²î±ð


InnoDB
ºÍMyISAM
ÊÇÔÚʹÓÃMySQL
×î³£ÓõÄÁ½¸ö±íÀàÐÍ£¬¸÷ÓÐÓÅȱµã£¬ÊÓ¾ßÌåÓ¦Óöø¶¨¡£»ù±¾µÄ²î±ðΪ£ºMyISAM
ÀàÐͲ»Ö§³ÖÊÂÎñ´¦ÀíµÈ¸ß¼¶´¦Àí£¬¶øInnoDB
ÀàÐÍÖ§³Ö¡£MyISAM
ÀàÐ͵ıíÇ¿µ÷µÄÊÇÐÔÄÜ£¬ÆäÖ´ÐÐÊý¶È±ÈInnoDB
ÀàÐ͸ü¿ì£¬µ«ÊDz»ÌṩÊÂÎñÖ§³Ö£¬¶øInnoDB
ÌṩÊÂÎñÖ§³ÖÒѾ­Íⲿ¼üµÈ¸ß¼¶Êý¾Ý¿â¹¦ÄÜ¡£
MyIASMÊÇIASM± ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ