QtÊý¾Ý¿â£¨¶þ£©Ìí¼ÓMySQLÊý¾Ý¿âÇý¶¯²å¼þ
±¾ÎÄÕÂÔ´´ÓÚwww.yafeilinux.com תÔØÇë×¢Ã÷³ö´¦¡£
ÔÚÉÏÒ»½ÚµÄĩβÎÒÃÇÒѾ¿´µ½£¬ÏÖÔÚ¿ÉÓõÄÊý¾Ý¿âÇý¶¯Ö»ÓÐ3ÖÖ£¬ÄÇôÔõÑùʹÓÃÆäËûµÄÊý¾Ý¿âÄØ£¿ÔÚQtÖУ¬ÎÒÃÇÐèÒª×Ô¼º±àÒëÆäËûÊý¾Ý¿âÇý¶¯µÄ´úÂ룬ÈÃËüÃÇÒÔ²å¼þµÄÐÎʽÀ´Ê¹Óá£ÏÂÃæÎÒÃǾÍÒÔÏÖÔڱȽÏÁ÷ÐеÄMySQLÊý¾Ý¿âΪÀý£¬ËµÃ÷Ò»ÏÂÔõÑùÔÚQt CreatorÖÐÌí¼ÓÊý¾Ý¿âÇý¶¯²å¼þ¡£
ÔÚ½²Êö֮ǰ£¬ÎÒÃÇÏÈ¿´Ò»ÏÂQt CreatorÖÐÊý¾Ý¿âµÄ²å¼þµ½µ×·ÅÔÚÄÄÀï¡£
ÎÒÃǽøÈëQt CreatorµÄ°²×°Ä¿Â¼£¬È»ºó½øÈëÏà¶ÔÓ¦µÄÎļþ¼ÐÏ£¬±È·½ÎÒÕâÀïÊÇ
D:\Qt\2010.02.1\qt\plugins\sqldrivers
ÔÚÕâÀïÎÒÃÇ¿ÉÒÔ¿´¼û¼¸¸öÎļþ£¬ÈçÏÂͼ£º
¸ù¾ÝÃû×ÖÖеĹؼü×Ö£¬ÎÒÃÇ¿ÉÒÔÅжϳöÕâ¾ÍÊÇODBCÊý¾Ý¿âºÍSQLiteÊý¾Ý¿âµÄÇý¶¯²å¼þ¡£ÏÂÃæÎÒÃDZàÒëºÃMySQLÊý¾Ý¿âÇý¶¯ºó£¬Ò²»áÔÚÕâÀï³öÏÖÏà¶ÔÓ¦µÄÎļþ¡£
Ê×ÏÈ£ºÎÒÃDz鿴ÔõÑù°²×°Êý¾Ý¿â²å¼þ¡£
ÎÒÃÇ´ò¿ªQt Creator£¬ÔÚ°ïÖúÖÐËÑË÷SQL Database Drivers¹Ø¼ü×Ö¡£ÕâÀïÁгöÁ˱àÒëQtÖ§³ÖµÄËùÓÐÊý¾Ý¿âµÄÇý¶¯µÄ·½·¨¡£
ÎÒÃÇÏÂÀµ½ÔÚwindowsÉϱàÒëQMYSQLÊý¾Ý¿â²å¼þµÄ²¿·Ö£¬ÆäÄÚÈÝÈçÏ£º
ÕâÀïÏêϸ½éÉÜÁËÕû¸ö±àÒëµÄ¹ý³Ì£¬Æä¿ÉÒÔ·ÖΪÒÔϼ¸²½£º
µÚÒ»£¬ÏÂÔØMySQLµÄ°²×°³ÌÐò£¬ÔÚ°²×°Ê±Ñ¡Ôñ¶¨ÖÆ°²×°£¬ÕâʱѡÖа²×°LibsºÍIncludeÎļþ¡£°²×°Î»ÖÿÉÒÔÊÇC:\MySQL ¡£
×¢Ò⣺°²×°Î»Öò»½¨Òé¸Ä¶¯£¬ÒòΪÏÂÃæ½øÐбàÒëµÄÃüÁîÖÐʹÓÃÁË°²×°Â·¾¶£¬Èç¹û¸Ä¶¯£¬ÄÇôÏÂÃæÒ²Òª½øÐÐÏàÓ¦¸Ä¶¯¡£
µÚ¶þ£¬½øÐбàÒë¡£ÎÒÃÇ°´ÕÕʵ¼ÊÇé¿öÊäÈëµÄÃüÁîÈçÏ¡£
cd %QTDIR%\src\plugins\sqldrivers\mysql
qmake “INCLUDEPATH+=C:\MySQL\include” “LIBS+=C:\MySQL\lib\opt\libmysql.lib” mysql.pro
mingw32-make
×¢Ò⣺ÔÚÉÏÃæµÄÃüÁîÖÐqmakeÖ®ºóÈç¹û¼ÓÉÏ“-o Makefile”Ñ¡ÏÄÇôÕâ¸ö²å¼þÖ»ÄÜÔÚÒÔreleaseģʽ±àÒë³ÌÐòʱ²ÅÄÜʹÓã¬ËùÒÔÎÒÃÇÉÏÃæûÓмÓÕâ¸öÑ¡Ïî¡£
È»ºó£ºÎÒÃÇ°´ÕÕÉÏÃæµÄ¹ý³Ì½øÐÐÏàÓ¦²Ù×÷¡£
1.ÎÒÃÇÏÈÏÂÔØMySQLµÄ°²×°Îļþ¡£
ÎÒÃÇ¿ÉÒÔµ½MySQLµÄ¹Ù·½Ö÷Ò³ http://www.mysql.com ½øÐÐÏÂÔØ×îеÄMySQLµÄwindows°æ±¾£¬ÏÖÔÚ¾ßÌåµÄÏÂÔØÒ³ÃæµØַΪ£º
http://www.mysql.com/downloads/mirror.php?id=383405#mirrors
ÎÒÃDz»½øÐÐ×¢²á£¬Ö±½Óµã»÷ÆäÏÂÃæµÄ
No thanks, just take me to the downloads!
¿ÉÒÔÔÚÆäÖÐÑ¡ÔñÒ»¸ö¾µÏñÍøµã½øÐÐÏÂÔØ£¬ÎÒʹÓõÄÊÇAsiaϵÄ×îºóÒ»¸ö£¬¾ÍÊÇ̨ÍåµÄ¾µÏñÍøµãÏÂÔصġ£
ÏÂÔص½µÄÎļþÃûΪ£ºmysql-essential-5.1.44-win32 £¬ÆäÖеÄwin32±íÃ÷ÊÇ32λµÄwindowsϵͳ£¬ÕâÒ»µã
Ïà¹ØÎĵµ£º
ת×Ôhttp://www.linuxbyte.org/yi-ge-mysql-server-shang-de-xiao-ji-qiao.html
ÔÚmy.cnf µÄ mysql ¶Ë Ìí¼ÓÈçÏÂÉèÖÃ
[mysql]
#no-auto-rehash # faster start of mysql but no tab completition
prompt="(\u:mysql1@linuxbyte.org \R:\m)[\d]: "
»á²úÉúÈçÏÂЧ¹û:
root@ubuntu:/home/hew# mysql -u hew -p
Enter pass ......
php½Ì³Ì mysql½Ì³Ì_connect Óëmysql_pconnectº¯ÊýÓëʵÀý½Ì³Ì
mysql_connect
mysql_connect($this->root,$this->user,$this->pass)
/*
mysql_connect ,µ¥¸ö·´ÎÊÓû§²»»áƵ·±µÄµ÷ÓÃÊý¾Ý¿â½Ì³Ì£¬Ã»±ØÒª±£³ÖÁ¬½Ó£¬¶øÇÒmysqlµÄÁ¬½ÓÊýÒ²ÊÇÓÐÏÞÖƵģ¬ ʹÓà ¼°Ê±·ÃÎʱȽÏƵ·±£¬Ò²×îºÃʹÓÃmysql_connect£¬ÕâÑùÊ¹Ó ......
ÍøÕ¾µÄÊý¾Ý¿âÊǵ÷ÓÃÔ¶³Ì·þÎñÆ÷ÉϵÄ,²»ÊDZ¾»úµÄ.ÍøÕ¾´ò¿ª±È½ÏÂý.ÔÚÍøÉÏËÑË÷ÁË·½·¨,Õâ¸ö·½·¨¿ÉÒÔ½â¾ö,µ«ÊÇÓÐÁíÍâµÄÎÊÌâ³öÏÖ:
-----------------------------------------------------------------------
ÔÚ¾ÖÓòÍøÄÚÁ¬½ÓÆäËû»úÆ÷µÄMYSQL,·¢ÏÖËÙ¶ÈÂýµÄºÜ,²»ÖªµÀʲôÔÒò,×ÜÓм¸ÃëµÄÑÓ³Ù.
ºóÀ´ÔÚÍøÉÏ·¢ÏÖ½â¾ö·½·¨,my.iniÀïÃæÌ ......
MySQL³£ÓÃÃüÁî×ܽá
===MySQL»ù´¡====
mysqlÏÂÔØ: http://www.mysql.com/
mysqld ³£¹æMySQL·þÎñÆ÷
mysqld-opt ÓÅ»¯mysql·þÎñÆ÷,ÌṩһЩ¹¦ÄÜ¿ÉÒÔÍÚ¾ò¸üºÃµÄ¹¦ÄÜ
mysqld-max ÓëmysqldÒ»Ñù,µ«¿ÉÒÔÖ§³Ö¸üÐÂ,¸ü¾ßʵÑéÐÔÖʵŦÄÜ(¸ü²»Îȶ¨)
++°²×°mysql
²Î¼û×Ô´øµÄINSTALL-SOURCEÎļþ
$ ./configure –prefix=/app/m ......