phpÁ¬½Ómysql²âÊÔºÍÅäÖÃ
phpÁ¬½Ómysql²âÊÔ´úÂ룺
$link=mysql_connect('localhost','root','123456');
if(!$link) echo "ʧ°Ü!";
else echo "³É¹¦!";
mysql_close();
?>
ÔËÐдúÂë³öÏÖ£ºCall to undefined function 'mysql_connect()'… ʧ°Ü
°Ù¶ÈÕÒµ½½á¹ûÊÇPHP+MYSQL »·¾³Ã»ÅäÖúÃ, php5 µÄĬÈÏ mysql ÊǹرյÄ
½«php_mysql.dllºÍlibmysql.dllÎļþ¿½±´ÖÁc:\winnt\system32ÖУ¨ÎÒ©ÁËlibmysql.dll£©
ÕÒµ½php.iniÖеÄ;extension=php_mysql,È¥µôÇ°ÃæµÄ";" ÖØÆô·þÎñÆ÷.
Ïà¹ØÎĵµ£º
³£ÓõÄ:
µ¼³ö
mysqldump -hyour_host -uyour_username -pyour_password database_name > file.sql
µ¼Èë
mysql -hyour_host -uyour_username -pyour_password database_name < file.sql
»òÕßÏÈÓÃmysql¿Í»§¶ËµÇ½ºó£¬
>\. file.sql
Ò²¿ÉÒÔÍê³Éµ¼È빦ÄÜ
ÉÏÃæµÄÁ½¸öÃüÁî½áºÏÆðÀ´Ó㬿ÉÒÔÍê³É½«Ò»¸öÊý¾Ý¿âµÄ ......
mysqlÊý¾Ý¿âlimit²éѯÓÅ»¯
MYSQLµÄÓÅ»¯ÊǷdz£ÖØÒªµÄ¡£ÆäËû×î³£ÓÃÒ²×îÐèÒªÓÅ»¯µÄ¾ÍÊÇlimit¡£mysqlµÄlimit¸ø·ÖÒ³´øÀ´Á˼«´óµÄ·½±ã£¬µ«Êý¾ÝÁ¿Ò»´óµÄʱºò£¬limitµÄÐÔÄܾͼ±¾çϽµ¡£
ͬÑùÊÇÈ¡10ÌõÊý¾Ý
select * from yanxue8_visit limit 10000,10 ºÍ
select * from yanxue8_visit limit 0,10
¾Í²»ÊÇÒ»¸öÊýÁ¿¼¶±ðµ ......
InnoDB,ÆÕͨµÄmysql
dump±¸·ÝÏÂÀ´,mysql»Ö¸´ÆðÀ´ÂýµÃÒª
ËÀ.
ÓÚÊÇÍøÉÏÕÒÁ˺þÃ,²ÅÕÒµ½Õâô¸ö¹¤¾ß
.
http://launchpad.net/percona-xtrabackup/release-1.2/release-1.2/+download/xtrabackup-1.2.tar.gz
ÏȲâÊÔÏÂÔÙ˵.
¿ÉÒÔÕâô±¸·Ý:
MyISAM
񡜧
/usr/local/mysql/bin/mysqldump -uyejr -pyejr
--default-char ......
×î½üдÁËÒ»¸ö¼òµ¥µÄMysql²Ù×÷À࣬ÄóöÀ´ºÍ´ó¼Ò·ÖÏíһϣ¬»¹Çë¸÷λ¸ßÊÖÖ¸ÕýÒ»ÏÂÎö¹¹º¯ÊýµÄÓ÷¨£º
<?php
/*
* Created on 2010-5-25
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*
* class mysql
* made by S71ENCE
*/
class mysql ......
×öһЩÊý¾Ý¿â²éѯ£¬²»½öÏ£ÍûµÃµ½Òª²éѯµÄ½á¹û£¬»¹Ï£Íû·½±ãµØÍ³¼ÆÒ»Ï²éѯ½á¹ûÖÐÓжàÉÙÌõ¼Ç¼¡£ÎÒͨ³£µÄ×ö·¨ÊÇ£º
$q = "select * from $fromTable where $where limit $start,$pageSize";
$r = mysql_query($q);
$q = "select count(*) from $fromTable where $where";
$cnt = mysql_query($q);
µ± ......