ʹÓÃMySQL connector/C++Á´½ÓMySQLÊý¾Ý¿â
Ê×ÏÈÈ¥MySQL¹ÙÍøÏÂÔØMySQL connector/C++
http://dev.mysql.com/downloads/connector/cpp/1.0.html
ÏÂÔصڶþ¸ö°ü£¬windows32λ·Ç°²×°°æ£¨¸öÈ˾õµÃÕâ¸ö°ü¸É¾»£©¡£Ä¿Ç°µÄ°æ±¾ÊÇConnector/C++ 1.0.5¡£
Windows (x86, 32-bit), ZIP Archive
(mysql-connector-c++-noinstall-1.0.5-win32.zip)
½«Õû¸ö°ü½âѹµ½ÏîÄ¿Îļþ¼ÐϵĵÄÔ´ÎļþĿ¼¡£Îļþ¼ÐÃû×ÖÌ«³¤£¬½«“mysql-connector-c++-noinstall-1.0.5-win32”¸ÄΪ“mysql”¡£
ÏÂÃæÒªÅäÖÃvs2008µÄ»·¾³¡£
1. ÏîÄ¿ÊôÐÔÒ³->C/C++->General->Additional Include Directories¡£½«mysql\includeĿ¼ºÍmysql\include\cppconnĿ¼Ìí¼Ó½øÈ¥¡£
2. ÏîÄ¿ÊôÐÔÒ³->Linker->General->Additional Library Directories¡£½«mysql\libĿ¼Ìí¼Ó½øÈ¥¡£
3. ÏîÄ¿ÊôÐÔÒ³->Linker->Input->Additional Dependencies¡£Ìí¼ÓÕâÁ½Ïîmysqlcppconn.lib£¬mysqlcppconn-static.lib£¨mysql\libĿ¼ÏµÄÁ½¸ö.libÎļþ£©
4. ½«mysql\libϵÄmysqlcppconn.dllÎļþ¸´ÖƵ½windows\system32Îļþ¼ÐÏ¡£
»·¾³ÅäÖÃÍê±Ï¡£
ÔÚÁ¬½ÓÊý¾Ý¿â֮ǰ£¬ÏȽ¨Á¢Ò»ÕÅ±í¡£
£¨ÆäʵÕâЩ¿ÉÒÔÔÚ´úÂëÖÐÍê³É£¬ÎÒÕâÑùÊÇΪÁËÈòâÊÔ´úÂ뾡¿ÉÄܼòÁ·Òײé´í£©
´ò¿ª¿ØÖÆ̨£¬ÊäÈëmysql -u root -p£¬ÊäÈëÃÜÂë¡£
²é¿´µ±Ç°ÒÑÓеÄÊý¾Ý¿â¡££¨SQLÓï¾äĩβ¼ÓÉÏ';'±íʾÁ¢¼´Ö´Ðе±Ç°Óï¾ä¡££©
mysql> show databases;
´´½¨Êý¾Ý¿â
mysql> create database test;
ʹÓÃÊý¾Ý¿â£¨Õâ¾ä²»Äܼӷֺţ©
mysql> use test
²é¿´ÒÑÓеıí
mysql> show tables;
´´½¨±í
mysql> create table testuser ( id INT, name CHAR(20));
²åÈëÊý¾Ý
mysql> insert into testuser(id, name) values(1001, 'google');
mysql> insert into testuser(id, name) values(1002, 'kingsoft');
mysql> insert into testuser(id, name) values(1003, 'firefox');
ÏÖÔÚÔÚC++ÖвéѯÕâЩÊý¾Ý
#include "stdafx.h"
#include <mysql_connection.h>
#include <mysql_driver.h>
#include <statement.h>
using namespace sql;
using namespace std;
void RunConnectMySQL()
{
mysql::MySQL_Driver *driver;
Connection *con;
Statement *state;
ResultSet *result;
// ³õʼ»¯Çý¶¯
driver = sql::mysql::get_mysql_driver_instance();
// ½¨Á¢Á´½Ó
con = driver->connect("tc
Ïà¹ØÎĵµ£º
ÓÃInstallAnywhere´ò°üJava³ÌÐò°üº¬MySQLÊý¾Ý¿â
InstallAnywhere´ò°üJava³ÌÐòʱ¿ÉÒÔ×Ô¶¯Íê³ÉjreµÄ´ò°ü£¬µ«ÊÇÐèÒªMySQLÊý¾Ý¿âµÄ³ÌÐò¾ÍµÃÊÖ¶¯Ìí¼Ó¡£×ÊÁÏÌ«ÉÙ£¬¾À½áÁËÈýÌ죬ÖÕÓÚ½â¾ö
1¡¢ ÏÂÔØÂÌÉ«°æµÄMySQL£¬¿ÉÒÔÈ¥¹ÙÍøÏÂÔØ¡£ÍøÓÑÖÆ×÷ÁËMySQLµÄÂÌÉ«¾«¼òBat°æ£¨http://download.csdn.net/source/524812 ......
2009-12-08 18:53
sql½Å±¾ÊÇ°üº¬Ò»µ½¶à¸ösqlÃüÁîµÄsqlÓï¾ä£¬ÎÒÃÇ¿ÉÒÔ½«ÕâЩsql½Å±¾·ÅÔÚÒ»¸öÎı¾ÎļþÖУ¨ÎÒÃdzÆ֮Ϊ“sql½Å±¾Îļþ”£©£¬È»ºóͨ¹ýÏà¹ØµÄÃüÁîÖ´ÐÐÕâ¸ösql½Å±¾Îļþ¡£»ù±¾²½ÖèÈçÏ£º
1¡¢´´½¨°üº¬sqlÃüÁîµÄsql½Å±¾Îļþ
ÎļþÖаüº¬Ò»Ð©ÁеÄsqlÓï¾ä£¬Ã¿ÌõÓï¾ä×îºóÒÔ;½á⣬ÎļþÄÚÈÝʾÀýÈçÏ£º
--´´½ ......
Galera ÊÇÒ»Ì×ÔÚ MySQL InnoDB ÉÏÃæʵÏÖ Multi-master ÇÒ synchronous replication µÄϵ統¡£
¸Ã°æ±¾ÐÞ¸´ÁË9¸öbug£¬Ö÷ÒªÊÇ´¦Àí DDL ºÍ DML µÄ²¢·¢ÎÊÌ⣬ÁíÍâ»ù×¼MySQL°æ±¾Éý¼¶µ½ 5.1.41 ¡£
ÏÂÔصØÖ·£º http://www.codership.com/en/downloads/galera
......
mysqlÖÐchar¡¢varchar¡¢nvarcharÊý¾ÝÀàÐ͵ÄÓ÷¨Çø±ð:
˵Ã÷:
1¡¢char:
¹Ì¶¨³¤¶ÈµÄ·Ç Unicode ×Ö·ûÊý¾Ý£¬×î´ó³¤¶ÈΪ 8,000 ¸ö×Ö·û¡£
2¡¢varchar£º
¿É±ä³¤¶ÈµÄ·Ç Unicode Êý¾Ý£¬×Ϊ 8,000 ¸ö×Ö·û¡£
3¡¢nvarchar£º
¿É±ä³¤¶È Unicode Êý¾Ý£¬Æä×î´ó³¤¶ÈΪ 4,000 ×Ö·û¡£  ......