VB6.0ÈçºÎÓà libmySQL.dll API·ÃÎÊMYSQLÊý¾Ý¿â
MYSQL Ó¦ÓÃÊ®·Ö¹ã·¶£¬ºÜ¶àÍøÕ¾¼¸ºõ¶¼ÔÚÓÃËû£¬ÒòΪËûµÄСÇɺÍÁé»îÐԵȷ½ÃæÈÃÎÒ¾ö¶¨Òª¶ÔËû½øÐÐÑо¿£¬µ½ÏÖÔÚÒѾ³É¹¦µÄ²»Óþ¹ýODBC£¬ADOµÈ·½Ê½¾Í¿ÉÒÔ¶ÁÈ¡ºÍ¸üÐÂÊý¾Ý¡£
ºÃÁ˲»¶àÂÞ࣬ÒÔÏÂÎÒÀ´½éÉÜ×ܸö³ÌÐòµÄϸ½Ú:
£¨Ò»£©APIÉùÃ÷
1. '·ÖÅä»ò³õʼ»¯ÊʺÏmysql_real_connect()µÄÒ»¸öMYSQL¶ÔÏñ¡£
Public Declare Function mysql_init Lib "libmySQL" (ByVal lMysql As Long) As Long
2. '¹Ø±ÕÒ»¸öÒÔÇ°´ò¿ªÁ˵ÄÁ¬½Ó
Public Declare Sub mysql_close Lib "libmySQL" (ByVal lMysql As Long)
3. 'ÄÜÓÃì¶ÉèÖöîÍâÁ¬½ÓÑ¡Ïî²¢ÇÒÓ°ÏìÒ»¸öÁ¬½ÓµÄÐÐΪ¡£
'Õâ¸öº¯Êý¿ÉÒÔ±»¶à´Îµ÷ÓÃÀ´ÉèÖöà¸öÑ¡Ïî¡£
'mysql_options()Ó¦¸ÃÔÚmysql_init()Ö®ááºÍmysql_connect()»òmysql_real_connect()֮ǰµ÷Óá£
'option²ÎÊýÊÇÄãÏëÒªÉèÖõÄÑ¡Ï
'arg ²ÎÊýÊÇÑ¡ÏîµÄÖµ¡£Èç¹ûÑ¡ÏîÊÇÒ»¸öÕûÊý£¬ÄÇ÷áargÓ¦¸ÃÖ¸ÏòÕûÊýÖµ¡£
Public Declare Function mysql_options Lib "libmySQL" _
(ByVal lMysql As Long, _
ByVal lOption As Long, _
ByVal sArg As String) As Long
4. ÉèÖÿͻ§¶Ë·ÃÎʵÄ×Ö·û¼¯ £¨Õâ¸öºÜÖØÒª£¬·ÃÎÊÖÐÎÄʱһ¶¨ÒªÓÃÕâ¸ö£©
Public Declare Function mysql_set_character_set Lib "libmySQL" (ByVal lMysql As Long, ByVal cs_name As String) As Long
5.Áª½ÓÊý¾Ý¿â
Public Declare Function mysql_real_connect Lib "libmySQL" _
(ByVal lMysql As Long, _
Ïà¹ØÎĵµ£º
1.Ö»¸´ÖƱí½á¹¹µ½Ð±í
CREATE TABLE бí SELECT * from ¾É±í WHERE 1=2
»òCREATE TABLE бí LIKE ¾É±í
2.¸´ÖƱí½á¹¹¼°Êý¾Ýµ½Ð±í
CREATE TABLE бí SELECT * from ¾É±í
3.¸´ÖƾɱíµÄÊý¾Ýµ½Ð±í(¼ÙÉèÁ½¸ö±í½á¹¹Ò»Ñù)
INSERT INTO бí SELECT * from ¾É±í
4.¸´ÖƾɱíµÄÊý¾Ýµ½Ð±í(¼ÙÉèÁ½¸ö±í½á¹¹²»Ò»Ñù)
......
¡¡¡¡mysql³ö´íÁË,ÒÔÇ°ÍùÍù¿¿²Â.ÓÐÁËÕâÕűí,Ò»²é¾Í³öÀ´ÁË.·½±ã²»ÉÙ.Ìع²ÏíÓÚÖÚ
1005£º´´½¨±íʧ°Ü
1006£º´´½¨Êý¾Ý¿âʧ°Ü
1007£ºÊý¾Ý¿âÒÑ´æÔÚ£¬´´½¨Êý¾Ý¿âʧ°Ü
1008£ºÊý¾Ý¿â²»´æÔÚ£¬É¾³ýÊý¾Ý¿âʧ°Ü
1009£º²»ÄÜɾ³ýÊý¾Ý¿âÎļþµ¼ÖÂɾ³ýÊý¾Ý¿âʧ°Ü
1010£º²»ÄÜɾ³ýÊý¾ÝĿ¼µ¼ÖÂɾ³ýÊý¾Ý¿âʧ°Ü
1011£ºÉ¾³ýÊý¾Ý¿âÎļþʧ ......
½ñÌì¸ãÁËÒ»Ì죬ÖÕÓڸ㶨ÁË¡£
¶ÔÓÚMysqlÓÐÁ½ÖÖģʽ£¬MYISAMÓëINNODB
Èç¹ûÊÇMYISAMµÄ»°£¬ÔÚdataĿ¼ÏÂÀï»á.frm .myd .myi ÈýÖÖÎļþ£¬ÄÇôֱ½Ó°ÑDATAÒƹýÈ¥£¬ÅäÖúÃȨÏ޾ͿÉÒÔ»¹ÔÁË¡£
Èç¹ûÊÇINNODBµÄ»°£¬ÄÇÊÇÏ൱µÄ·³°¡¡£ÔÚdataĿ¼ÏÂÖ»ÓÐ.frm(ÕâÖ»ÊÇÒ»¸öÊý¾Ý¸ñʽ£©£¬Õâ¸öÒƹýÈ¥ºó£¬ÊÇÎÞ·¨»¹ÔÔʼÊý¾ÝµÄ¡£
ÕæÕýµÄÊý¾ÝÊÇÕ ......
1¡¢ÔÚ¿ØÖÆִ̨ÐÐ mysql -u root -p mysql£¬ÏµÍ³ÌáʾÊäÈëÊý¾Ý¿ârootÓû§µÄÃÜÂ룬ÊäÈëÍê³Éºó¼´½øÈëmysql¿ØÖÆ̨£¬Õâ¸öÃüÁîµÄµÚÒ»¸ömysqlÊÇÖ´ÐÐÃüÁµÚ¶þ¸ömysqlÊÇϵͳÊý¾ÝÃû³Æ£¬²»Ò»ÑùµÄ¡£
2¡¢ÔÚmysql¿ØÖÆִ̨ÐÐ GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'MyPassword' WITH GRANT OPTION;
3¡¢ÔÚmysql¿ØÖÆ ......