VCµ¥ÎļþÁ¬½ÓMYSQLʾÀý£¬¶ªµôlibmysql.dll.
ÍøÉϺܶàVCÁ¬½ÓmysqlµÄÀý×Ó¶¼ÊÇÒª´ø¸ölibmysql.dll²ÅÄÜÕý³£Ê¹Óõġ£
µ«ÓÐʱÎÒÃDz¢²»Ïë¶à´ø¸ölibmysql.dll£¬Ö»Ïëµ¥Îļþ¾ÍÄÜʹÓûòÕßÄãÊÇÒª
·â×°ÔÚÒ»¸ödllÎļþÀÕâʱÄãÒª¾ÍÓõ½mysqlclient.libÕâ¸ö¾²Ì¬¿âÁË¡£
ʾÀý´úÂëÈçÏ£¬ºÜºÜ¼òµ¥£¬¾Í²»¶à˵ÁË¡£
Ïà¹ØµÄmysqlÍ·Îļþ¼°¾²Ì¬¿â£º
http://download.csdn.net/source/1047386
#include "stdafx.h"
#include <windows.h>
#include <winsock2.h>
#include "mysql\include\mysql.h"
//ºöÂÔLIBCMT.lib, MSVCRTD.libÕâЩ¿â£¬²»È»Á´½Óʱ»á±¨lnk2005´íÎó
#pragma comment(linker,"/nodefaultlib:LIBCMT.lib")
#pragma comment(linker,"/nodefaultlib:MSVCRTD.lib")
/*ÓÃmysqlclient.lib,²»ÒªÓÃlibmysql.lib,Òª²»ÄãÒª¶à´øÒ»¸ölibmysql.dll
¾²Ì¬¿âÓÐÁ½¸ö£¬Ò»¸öÊÇdebug°æµÄ£¬Ò»¸öÊÇrelease°æµÄ£¬Òª×¢Òâ
*/
#if defined _DEBUG
#pragma comment(lib, "mysqlclient_debug.lib")
#else
#pragma comment(lib, "mysqlclient.lib")
#endif
#pragma comment(lib, "wsock32.lib")
#pragma comment(lib, "Advapi32.lib")
int _tmain(int argc, _TCHAR* argv[])
{
MYSQL* mysql = NULL;
mysql = mysql_init(mysql);
MYSQL_RES* res;
MYSQL_ROW record;
mysql_real_connect(mysql, "192.168.0.240", "root","root", "amx", 3306, NULL, NULL);
mysql_query(mysql, "select auth, password, access from admins where length(access)>3");
res = mysql_store_result(mysql);
while((record=mysql_fetch_row(res)))
{
printf("auth=%s,password=%s,access=%s\n", record[0], record[1], record[2]);
}
mysql_free_result(res);
mysql_close(mysql);
return 0;
}
Ïà¹ØÎĵµ£º
1¡¢½¨Á¢ÁËÒ»¸öj2eeÏîÄ¿¡£
2¡¢½«mysqlµÄjdbcÇý¶¯¿½±´µ½WebContent / WEB-INF/ lib Ŀ¼Ï¡£
3¡¢ÔÚÇý¶¯jar°üÉϵãÓÒ¼ü½«jar°üÌí¼Óµ½¹¹½¨Â·¾¶ÖС£
4¡¢È»ºó±àдÓëÊý¾Ý¿âÏà¹ØµÄ´úÂë¡£
5¡¢ÔÚʵÏÖÀàÖÐÌí¼Ómain·½·¨½øÐе¥Ôª²âÊÔ£¬¸÷¸ö·½·¨¶¼ÄÜÕý³£ÔËÐС£
6¡¢´´½¨jspÒ³ÃæÔÚÆäÖд´½¨¶ÔÏóµ÷Óòéѯ·½·¨¡£²úÉú´íÎó¡£
cn.guopeng.bbs ......
·ÀÖ¹×¢ÈëµÄ¼¸ÖÖ°ì·¨
ÆäʵÔÀ´¾ÍÊÇÎÒÃÇÐèÒª¹ýÂËһЩÎÒÃdz£¼ûµÄ¹Ø¼ü×ֺͷûºÏÈ磺
Select£¬insert£¬update£¬delete£¬and£¬*£¬µÈµÈ
function inject_check($sql_str) {
return eregi('select|insert|update|delete|\'|\/\*|\*|\.\.\/|\.\/|union|into|load_file
|outfile', $sql_str); & ......
1.ÔÚORACLEÖÐÓÃselect * from all_usersÏÔʾËùÓеÄÓû§£¬¶øÔÚMYSQLÖÐÏÔʾËùÓÐÊý¾Ý¿âµÄÃüÁîÊÇshow
databases¡£¶ÔÓÚÎÒµÄÀí½â£¬ORACLEÏîÄ¿À´ËµÒ»¸öÏîÄ¿¾ÍÓ¦¸ÃÓÐÒ»¸öÓû§ºÍÆä¶ÔÓ¦µÄ±í¿Õ¼ä£¬¶øMYSQLÏîÄ¿ÖÐÒ²Ó¦¸ÃÓиöÓû§ºÍÒ»¸ö¿â¡£ÔÚ
ORACLE(db2Ò²Ò»Ñù)Öбí¿Õ¼äÊÇÎļþϵͳÖеÄÎïÀíÈÝÆ÷µÄÂß¼±íʾ£¬ÊÓͼ¡¢´¥·¢Æ÷ºÍ´æ´¢¹ý³ÌÒ²¿É ......
½ñÌìÐèÒª´ÓÔ¶³Ì·þÎñÆ÷downÒ»¸öuchomeµÄÊý¾Ý¿âÏÂÀ´£¬ÔÚ±¾µØ»¹Ô¡£
·¢ÏÖÒ»¸öºÜ²»Ë¬µÄÊÂÇ飺Զ³Ì8G£¬NºËµÄlinux»úÆ÷£¬±¸·Ý»¹Ô²Ù×÷˳ÁïÁïµÄ£¬¿ÉÊÇÔÚ±¾µØµÄwindows£¬2GÆÕͨPCÉÏ£¬²Å100MµÄÎļþ£¬ÓÃuchome×Ô´øµÄ·Ö¾í±¸·Ý»¹Ô£¬»ù±¾ÉÏÖм䶼»á¶Ïµô£¬ÒªÃ´Ìáʾ“Ö´ÐÐʱ¼ä¹ý³¤”£¨¸Ä³É200Ã룬·Ö¾íΪ20M¶¼²»ÐУ©£¬ÒªÃ´¾ÍÊ ......
mysql> desc aa;
+-------+---------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------+------+-----+---------+-------+
| id | int(11) | YES | | NULL | &n ......