mysql±¨´í
±¨´í£º
/tmp/ccBBJEB8.o: In function `ping_sql':
pingsql.c:(.text+0x7c): undefined reference to `mysql_init'
pingsql.c:(.text+0xe1): undefined reference to `mysql_real_connect'
pingsql.c:(.text+0xff): undefined reference to `mysql_close'
pingsql.c:(.text+0x119): undefined reference to `mysql_connect'
pingsql.c:(.text+0x198): undefined reference to `mysql_real_escape_string'
collect2: ld ·µ»Ø 1
½â¾ö°ì·¨£º
#gcc -o pingsql pingsql.c -lmysqlclient -I/usr/local/mysql/include/mysql/ -L/usr/local/mysql/lib/mysql
Ïà¹ØÎĵµ£º
ÓÐʱºònginx£¬apache£¬mysql£¬php±àÒëÍêÁËÏë¿´¿´±àÒë²ÎÊý¿ÉÒÔÓÃÒÔÏ·½·¨
nginx±àÒë²ÎÊý£º
#/usr/local/nginx/sbin/nginx -V
CODE:
nginx version: nginx/0.6.32
built by gcc 4.1.2 20071124 (Red Hat 4.1.2-42)
configure arguments: --user=www --group=www --prefix=/usr/local/nginx/ --with-http_stub_status_mo ......
2009Äê10ÔÂ30ÈÕ ÐÇÆÚÎå 22:53
ÓÃmysql
ÄÚÖú¯Êýת»»ipµØÖ·ºÍÊý×Ö
ÀûÓÃÁ½¸öÄÚÖú¯Êý
inet_aton:½«ipµØÖ·×ª»»³ÉÊý×ÖÐÍ
inet_ntoa:½«Êý×ÖÐÍת»»³ÉipµØÖ·
³ä·ÖÀûÓÃmysqlÄÚÖõÄ
format
º¯Êý
ÓÈÆäÊÇÔÚ´¦Àí×Ö·û¸ñʽµÄʱºò,ÀýÈ罫12345ת»»³É12,345ÕâÑùµÄ,Ö»ÒªÓÃ:format(12345,0)¼´¿É,Èç¹ûÓÃformat(12345,2)ÔòÏÔÊ ......
ÍøÉϺܶàдÔÚwindowsÏÂÎÞ·¨ÔØÈëmysqlÀ©Õ¹½â¾ö°ì·¨£¬µ«ÊÇÔÚliunxϵľÍû¼¸¸ö£¬ÒÔÏÂÊÇÔÚliunxϵĽâ¾ö°ì·¨
֨װºóphp²»»á×Ô¶¯°Ñmysql.soÀ©Õ¹¼ÓÉÏÈ¥,Òª
sudo vim /etc/php5/apache2/conf.d/pdo.ini
¼ÓÈëextension=mysql.so¾Í¿ÉÒÔÁË
ÆäʵҲ¿ÉÒÔÔÚ /etc/php5/apache2/php.iniÖмÓÈë
Ò²¿ÉÒÔÔÚ/etc/php5/apache2/conf. ......
Õâ¶Îʱ¼ä±»Õâ¸öÀ§ÈÅÁ˺ܾã¬Í¨¹ýÐÞ¸ÄÅäÖÃÎļþ£¬ÖÕÓÚ°ÑÕâ¸öÎÊÌâ½â¾öÁË¡£
×Ô¼ºÔÚÍøÉÏÒ²ÕÒÁËºÜ¶à¹ØÓÚ½â¾öÕâ¸öÎÊÌâµÄ·½·¨£¬µ«ÊǶ¼½²µÄ²»Ì«Çå³þ£¬ËùÒÔ½ñÌìÔÚÕâÖØÐÂ˵ÏÂÕâ¸öÎÊÌâ¡£
ÎҵĽâ¾ö·½·¨ÊÇͨ¹ýÐÞ¸ÄmysqlµÄÅäÖÃÎļþmy.ini£¬·½·¨ÈçÏ£º
ÔÚmy.iniÖпÉÒÔ·¢ÏÖÓÐÕâôһ¶Î´úÂ룺
[client]
port=3306
[mysql]
default ......
MySQL 5.1.40ÒѾ·¢²¼£¬ÔÚÕâÀïÓÐһЩеÄÌØÐÔ³öÏÖ£¬°üÀ¨MySQL»ùȺ»ùÓÚ´ÅÅ̵ÄÊý¾ÝÖ§³ÖµÈµÈ¡£¡¡¡¡MySQL 5.1.40ÒѾ·¢²¼£¬ÕâÒ»°æ±¾µÄMySQLÓкܶàÐµĹ¦ÄÜÌØÐÔ£¬Ï£ÍûÕâЩÐÂÌØÐÔÄÜÈôó¼Ò½ñºóµÄ¹¤×÷¸üÓÐЧÂÊ¡£MySQLÊÇÏÖÔÚ×îÁ÷ÐÐÒ»¸ö¶àÏ̵߳Ä,½á¹¹»¯²éѯÓïÑÔ(SQL)Êý¾Ý¿â·þÎñÆ÷.¾ø´ó¶àÊýPHPÍøÕ¾µÄÊý¾Ý¿âºǫ́¶¼ÊDzÉÓÃÕâÒ»Êý¾Ý¿â.
¡¡ ......