SQL Explorer QT4.5 ÅäÖÃMySQL ODBCºÍMySQLÇý¶¯
QT DataBase SQL Explorer
1¡¢°²×°MySQLµ½¹Ù·½ÍøÕ¾ÏÂÔØMySQLÊý¾Ý¿â£¬·Ç°²×°°æ£¬Ö±½ÓÔËÐÐmysqld½ø³Ìǰ̨µÄ
2¡¢Ìí¼Óϵͳ»·¾³±äÁ¿£¬Path+=':\mysql\bin'µÄpath£¬ÔÙÔÚ¿ªÊ¼ÔËÐУ¬CMD->mysql -uroot µÇ¼µ½mySQLÊý¾Ý¿â
Default passwordûÓеģ¬ÓеĻ° mysql -uroot -pÊäÈëÃÜÂ룻ÍøÂçµÇ¼£ºmysql -h ip -u user -p password;
3¡¢´´½¨±í»òÊý¾Ý¿â£¬ÓÃdefault Êý¾Ý¿âtest OR mysql¾ÍÐÐÁË¡£
4. ½¨±íʱҪעÒâÉèÖÃ×Ö·û¼¯£¬GBK,utf8,gb2312µÈ£»ÈçÏÂ:
---------------------------
CREATE TABLE BOOKS
(
bkid int not null auto_increment,
bkname varchar(24) CHARACTER SET gbk,
bkdate datetime,
PRIMARY KEY (bkid) --Ö÷¼ü
);
select * from BOOKS;
insert into BOOKS(bkname, bkdate) values('linux±à³ÌµÚÒ»°æ', '2009-05-25');
ÔÚCmd mysqlÏÂÈç¹ûÏÔʾÂÒÂ룬ÔòÒª ÉèÖà һ¸öµ±Ç°×Ö·û¼¯£¬
-> set names 'gbk';
5¡¢°²×°ODBC for win32,¿ÉÒÔµ½¹Ù·½ÍøÕ¾ÉÏÏÂÔØ·Ç°²×°°æ£¬Ö´ËüµÄInstall.bat°²×°ÏµÍ³ODBCÇý¶¯£¬È»ºóÔËÐÐODBCad32.exe ÅäÖÃÓû§ODBC dns;
-------------------------------------------------
6¡¢´ò¿ªdelphiʹÓÃADOÁ¬½ÓÅäÖúõÄODBC mysql µÄdns£¬Á¬½ÓOK£»
----------------------------------------------------------------
7¡¢QT4.5±È½ÏÂé·³£¬¿ÉÒÔʹmysql Çý¶¯»òODBCÁ¬½ÓMysqlÊý¾Ý¿â¡£
´¦ÀíÖÐÎÄ·½·¨£ºhttp://www.qtcn.org/bbs/read.php?tid=4229
8¡¢QT4.5±àÒëMySQLÇý¶¯
A. ÎÒµÄQT°²×°Ä¿Â¼ÔÚC:\Qt0904\qt¡¢Mysql°²×°ÔÚC:\mysql5140;
B. ´ò¿ªMySQL sqldrivers Çý¶¯²å¼þ¹¤³ÌÎļþÔÚ°²×°µÄQTĿ¼ÀÈçÎÒµÄ C:\Qt0904\qt\src\plugins\sqldrivers\mysqlÕâÀï;
C. Build: »á³öÏÖMysql.hµÄ°üº¬ÎļþÕÒ²»µ½£ºÖ±½Ó¼ÓÈëMysqlµÄincludeĿ¼INCLUDEPATH+=C:\MySQL\includeµ½¹¤³ÌÎļþÖÐ;
»òÖ±½Ó¼Óµ½Ädzö´íµÄÎļþÍ·ÉÏÈ¥: #include <C:\mysql5140\include\mysql.h>
D. ½ÓÏÂÀ´±àÒë»á³öÏÖERROR: cannot find -llibmysql
¼ÓÈ룺LIBS=C:\mysql5140\lib\opt\libmysql.lib Ò²¾ÍÊÇ°²×°Mysql Ŀ¼µÄµØ·½;
E. MYSQL Çý¶¯DLLÊä³öĿ¼£º´ÓC:\Qt0904\qt\s
Ïà¹ØÎĵµ£º
Ò»¡¢ ¼òµ¥²éѯ
¼òµ¥µÄTransact-SQL²éѯֻ°üÀ¨Ñ¡ÔñÁÐ±í¡¢from×Ó¾äºÍWHERE×Ӿ䡣ËüÃÇ·Ö±ð˵Ã÷Ëù²éѯÁС¢²éѯµÄ
±í»òÊÓͼ¡¢ÒÔ¼°ËÑË÷Ìõ¼þµÈ¡£
ÀýÈ磬ÏÂÃæµÄÓï¾ä²éѯtesttable±íÖÐÐÕÃûΪ“ÕÅÈý”µÄnickname×ֶκÍemail×ֶΡ£
SELECT nickname,email
from testtable
WHERE name='ÕÅÈý'
(Ò») Ñ¡ÔñÁÐ ......
ÔÚ½²MySQLµÄJoinÓ﷨ǰ»¹ÊÇÏȻعËÒ»ÏÂÁª½áµÄÓï·¨£¬ºÇºÇ£¬ÆäʵÁ¬ÎÒ×Ô¼º¶¼ÍüµÃ²î²»¶àÁË£¬ÄǾʹó¼ÒÒ»ÆðÎÂÏ°°É£¨Èç¹ûÄÚÈÝÓдíÎó»òÓÐÒÉÎÊ£¬¹úÄÚ¹ØÓÚMySQLÁª½á²éѯµÄ×ÊÁÏÊ®·ÖÉÙ£¬ÏàÐÅ´ó¼ÒÔÚ¿´Á˱¾Îĺó»á¶ÔMySQLÁª½áÓï·¨ÓÐÏ൱ÇåÎúµÄÁ˽⣬Ҳ²»»á±»OracleµÄÍâÁª½áµÄ£¨“£«”ºÅ£©ÅªµÃºýÍ¿ÁË¡£
ÔÚSQL±ê×¼Öй滮µÄ£¨ ......
ÏñPHPºÍperlÒ»Ñù£¬MySQLÒ²ÌṩµÄCÓïÑÔʹÓõÄAPI. C´úÂëµÄAPIÊÇËæMySQLÒ»Æð·¢²¼µÄ¡£ Ëü°üº¬ÔÚmysqlclient¿âÖУ¬ ¿ÉÒÔʹC³ÌÐòÀ´·ÃÎÊÊý¾Ý¿â¡£
MySQLÔ´Âë°üÖеÄÐí¶à¿Í»§¶Ë¶¼ÊÇÓÃCдµÄ¡£ Èç¹ûÄãÕýÔÚÕÒʹÓÃÕâЩC APIµÄÀý×Ó£¬ ¿ÉÒÔ¿´¿´¿Í»§¶ËµÄд·¨¡£Äã¿ÉÒÔÔÚMySQLÔ´Âë°üµÄclientsĿ¼ÕÒµ½ÕâЩÀý×Ó¡£
& ......
Ö´ÐÐ˳Ðò:´Ó×óµ½ÓÒ,±äÁ¿ÓÅÏÈ,ÖðÐиüÐÂ
Õª×ÔCSDNµÄÀý×Ó(http://topic.csdn.net/u/20091030/16/7fd75fa6-bdb9-4516-9b27-48aef69703ba.html
http://topic.csdn.net/u/20090904/16/e5dad9c7-fb59-41b9-b28d-e3b71c3e8420.html)
1.±äÁ¿ÓÅÏÈ
create table #t (field1 varchar(10),field2 varchar(10))
insert #t sel ......
SQLÓï¾äÏÈǰдµÄʱºò£¬ºÜÈÝÒ×°ÑһЩÌØÊâµÄÓ÷¨Íü¼Ç£¬ÎÒÌØ´ËÕûÀíÁËÒ»ÏÂSQLÓï¾ä²Ù×÷£¬·½±ã×Ô¼ºÐ´SQLʱ·½±ãÒ»µã£¬ÏëÌùÉÏÀ´£¬Ò»Æð¿´¿´£¬Í¬Ê±Ï£Íû´ó¼ÒÄܹ²Í¬¶à¶àÌáÒâ¼û£¬Ò²¸øÎÒÁôһЩ¸üºÃµÄ¼Ñ¾ä£¬ÕûÀíÒ»·Ý¡¶¾«ÃîSQLËÙ²éÊֲᡷ£¬²»Áߴͽ̣¡
Ò»¡¢»ù´¡
1¡¢ËµÃ÷£º´´½¨Êý¾Ý¿â
CREATE DATABASE database-name
2¡¢ËµÃ÷£ºÉ¾³ýÊý¾ ......