°²×°phpµÄʱºòûÓÐmysqlÖ§³ÖµÄºóÐø°²×°
ÒýÓÃhttp://www.icnote.com/Mysql-php-connector/
ÓÉÓÚ¹«Ë¾µÄ·þÎñÆ÷¿ªÊ¼Ö»ÊÇÓÃÓÚjavaµÄÖ§³Ö£¬×°ÁËapache£¬mysql£¬php£¬µ«ÊÇphpµÄ°²×°Ã»ÓжÔmysql½øÐÐÖ§³Ö£¬½ñÌì¶ÔËû½øÐÐÁËÀ©Õ¹£¬¼Ç¼ÈçÏ¡£
Ê×ÏÈ£¬°²×°mysqlºÍphpµÄÁ¬½ÓÀ©Õ¹£¬ÐèÒªÒÔϰü¡£¿ÉÒÔÔÚhttp://rpmfind.net/
ÕÒµ½£¬¸ù¾Ý¸÷×Ôphp°æ±¾Ñ¡Ôñ¡£
¿ÉÒÔʹÓÃ
#rpm -qa |grep php
½øÐв鿴
php-gd-5.1.6-3.i386.rpm
php-mbstring-5.1.6-15.el5.i386.rpm
php-mysql-5.1.6-3.i386.rpm
°²×°µÄʱºò×¢Ò⣬¿ÉÄÜÉÙÁËһЩÒÀÀµ£¬ËùÒÔ£¬±ØÐë¼ÓÉÏ--nodeps(ºöÂÔÒÀÀµ)¡£
¼´£º
#rpm -ivh php-gd-5.1.6-3.i386.rpm --nodeps
È»ºó¼ì²éÏ£¬¿´µ½ÒÔÏÂÄÚÈݾÍokÁË¡£
[lee@icnote soft]# ls -l /usr/lib/php/modules/
-rwxr-xr-x 1 root root 330636 2006-10-04 gd.so
-rwxr-xr-x 1 root root 40780 2006-12-20 ldap.so
-rwxr-xr-x 1 root root 1719696 2007-09-20 mbstring.so
-rwxr-xr-x 1 root root 106220 2006-10-04 mysqli.so
-rwxr-xr-x 1 root root 49028 2006-10-04 mysql.so
-rwxr-xr-x 1 root root 23756 2006-10-04 pdo_mysql.so
-rwxr-xr-x 1 root root 13004 2006-12-12 phpcups.so
[lee@icnote soft]# ls -l /etc/php.d/php
-rw-r--r-- 1 root root 45 2006-10-04 gd.ini
-rw-r--r-- 1 root root 49 2006-12-20 ldap.ini
-rw-r--r-- 1 root root 57 2007-09-20 mbstring.ini
-rw-r--r-- 1 root root 53 2006-10-04 mysqli.ini
-rw-r--r-- 1 root root 51 2006-10-04 mysql.ini
-rw-r--r-- 1 root root 59 2006-10-04 pdo_mysql.ini
[lee@icnote soft]# php -i |grep mysql
/etc/php.d/mysql.ini,
/etc/php.d/mysqli.ini,
/etc/php.d/pdo_mysql.ini
mysql
MYSQL_SOCKET => /var/lib/mysql/mysql.sock
MYSQL_INCLUDE => -I/usr/include/mysql
MYSQL_LIBS => -L/usr/lib/mysql -lmysqlclient
Ïà¹ØÎĵµ£º
½øÐÐÎļþµÄ¶ÁºÍд£¬ÏÈ´ò¿ªÒ»¸öÎļþ£¬È»ºó¿ªÊ¼¶Á»òÕßдÎļþ£¬×îºóÔÙ¹ØÏµÕâ¸öÎļþ×ÊÔ´¡£
È磬ÎļþµÄ¶Á²Ù×÷£º
<?php
$file = fopen('your file path','r');
while(!feof($file)){ //µ±Ã»ÓжÁÈ¡µ½Îļþ½á⣬¼ÌÐøÑ»·¶ÁÈ¡²Ù×÷
$line = fgets($file); //¶ÁÈ¡µ½Ò»ÐеÄÄÚÈÝ
echo $line.'<br/>';
}
fclose($file) ......
ÎÒÔÚ°²×°XAMPP 1.7.0ʱ£¬°²×°³É¹¦ºó£¬´òËãÆô¶¯XAMPP¡£Apache˳ÀûÆô¶¯£¬µ«ÊÇMySqlÔõô¶¼Æô¶¯²»ÁË£¬ÌáʾµÄ´íÎóÊÇ£º
error:mysql service not started [-1]
ÎÒÖØÐÂ×°Á˼¸´Î¶¼²»ÐУ¬ÏÂÔØÁËÆäËûµÄ°æ±¾Ò²²»ÐУ¬ÎÒÕæ¸ã²»Çå³þΪʲô¡£ÎÒGoogleÁ˰ëÌ죬ÆðÏÈʱÖÐÎÄÍøÒ³£¬°´ÕÕ¼¸¸ö½â¾ö·½·¨×öÁ˶¼²»ÐУ¬¿Ï¶¨ÊÇûÓжÔÖ¢ÏÂÒ©°Ñ£¬È»ºóÎÒµ ......
my.iniÎļþÅäÖ㺠[mysql] default-character-set=GBK #´Ë´¦µÄ±àÂëÊÇMySQL¿ØÖÆÌ¨ÏÔʾµÄ±àÂ뷽ʽ£¬Ó¦¸ÃÉèÖÃΪGBK [mysqld] default-character-set=utf8 #´Ë´¦µÄ±àÂëÊÇMySQLÊý¾Ý´æ´¢µÄ¸ñʽ£¬Ó¦¸ÃÉèÖÃΪutf8£¬¿ÉÒÔ´æ´¢ÊÀ½çÉϾø´ó¶àÊý×Ö·û ......
ÔÎÄÁ´½Ó£ºhttp://hi.baidu.com/171892549/blog/item/14818d0ac616ee34b1351dbd.html
ÔÚÊý¾Ý¿â±íÖУ¬Ê¹ÓÃË÷Òý¿ÉÒÔ´ó´óÌá¸ß²éѯËÙ¶È¡£
¼ÙÈçÎÒÃÇ´´½¨ÁËÒ»¸ö testIndex ±í£º
CREATE TABLE testIndex(i_testID INT NOT NULL,vc_Name VARCHAR(16) NOT NULL);
ÎÒÃÇËæ»úÏòÀïÃæ²åÈëÁË 1000 Ìõ¼Ç¼£¬ÆäÖÐÓÐÒ»Ìõ i_testID vc_Name ......
½¨Á¢Íâ¼üµÄǰÌ᣺ ±¾±íµÄÁбØÐëÓëÍâ¼üÀàÐÍÏàͬ(Íâ¼ü±ØÐëÊÇÍâ±íÖ÷¼ü)¡£
Íâ¼ü×÷Ó㺠ʹÁ½ÕűíÐγɹØÁª£¬Íâ¼üÖ»ÄÜÒýÓÃÍâ±íÖеÄÁеÄÖµ£¡
Ö¸¶¨Ö÷¼ü¹Ø¼ü×Ö£º foreign key(ÁÐÃû)
ÒýÓÃÍâ¼ü¹Ø¼ü×Ö£º references <Íâ¼ü±íÃû>(Íâ¼üÁÐÃû)
ʼþ´¥·¢ÏÞÖÆ: on deleteºÍon update , ¿ÉÉè²ÎÊýcascade(¸úËæÍâ¼ü¸Ä¶¯ ......