mysqlĬÈÏÊÇÖ»ÄÜ´Ólocalhost·ÃÎÊ
ËùÒÔ³ýÁ˸øÕË»§È¨ÏÞÒÔÍâ »¹ÓÐÐÞ¸Ä /etc/mysql/my.cnf
ÕÒµ½ bind-address = 127.0.0.1 ÐÞ¸ÄΪ bind-address = 0.0.0.0
ÖØÆômysql : sudo /etc/init.d/mysql restart
·ñÔò»á±¨ ERROR 2003 (HY000): Can't connect to MySQL server on 'x.x.x.x' (111)
ºÃ°É ÎÒÊÇmysql²ËÄñ ÒÔÇ°¶¼ÊÇ×ßlocalhostµÄ
Ïà¹ØÎĵµ£º
¡¡ÍøÉÏÓкܶàµÄÎÄÕ½ÌÔõôÅäÖÃMySQL·þÎñÆ÷£¬µ«¿¼Âǵ½·þÎñÆ÷Ó²¼þÅäÖõIJ»Í¬£¬¾ßÌåÓ¦ÓõIJî±ð£¬ÄÇЩÎÄÕµÄ×ö·¨Ö»ÄÜ×÷Ϊ³õ²½ÉèÖòο¼£¬ÎÒÃÇÐèÒª¸ù¾Ý×Ô¼ºµÄÇé¿ö½øÐÐÅäÖÃÓÅ»¯£¬ºÃµÄ×ö·¨ÊÇMySQL·þÎñÆ÷Îȶ¨ÔËÐÐÁËÒ»¶Îʱ¼äºóÔËÐУ¬¸ù¾Ý·þÎñÆ÷µÄ”״̬”½øÐÐÓÅ»¯¡£
mysql> show global status;
¡¡¡¡¿ÉÒÔÁгöMySQL·þÎ ......
ÏÂÎç¿´ÁËÒ»¶ÎPHP100µÄÊÓƵ¡£
Ò²ËãÓеãÊÕ»ñ¡£
ÀïÃæµÄÒ»¶Î×ÔдµÄfindallµÄSQLº¯Êý£º
public function findall($table) {
$this->query("SELECT * from $table");
}
ÔÀ´Ö»ÊÇÕâô¼òµ¥£¬¸Õ»¹ÔÚ˼¿¼¡£
ʹÓÃÁËTAB¼üÉÏÃæµÄ¶ÙºÅÀ´ÐÞÊÎMYSQLÀïµÄ×Ö¶ÎÃû£¬È磺
UPDATE tablename SET `fieldname`='values' wh ......
ÔÚÍøÕ¾½¨Éè»òÕßÔËÓªÖУ¬Èç¹û MySQL server ÊǷdz£·±Ã¦£¬¿ÉÒÔ¿ªÆô query cache ÒÔ¼ÓËÙ»ØӦʱ¼ä£¬¿ªÆô·½·¨¿ÉÒÔÔÚ my.cnf 裡Ãæ¼ÓÈëÒÔÏÂÏîÄ¿: (Redhat ÏÂÃæÊÇ /etc/my.cnf£»Debian ÊÇÔÚ etc/mysql
/my.cnf).
query_cache_size = 64M
query_cache_type = 1
query_cache_limit = 1048576
ÒÔÉÏÓï·¨µÄÉ趨ÀïÃ棬 ......
MysqlÊý¾Ý¿âÊÇÒ»¸ö¶àÓû§£¬¶àÏ̵߳ĹØϵÐÍÊý¾Ý¿â£¬ÊÇÒ»¸ö¿Í»§»ú/·þÎñÆ÷½á¹¹µÄÓ¦ÓóÌÐò¡£ËüÊǶԸöÈËÓû§ºÍÉÌÒµÓû§ÊÇÃâ·ÑµÄ.
MysqlÊý¾Ý¿â¾ßÓÐÒÔÏÂÓŵ㣺
1.ͬʱ·ÃÎÊÊý¾Ý¿âµÄÓû§µÄÊýÁ¿²»ÊÜÏÞÖÆ
2.¿ÉÒÔ±£´æ³¬¹ý5ǧÍòÌõµÄ¼Ç¼
3.ÊÇÄ¿Ç°Êг¡ÉÏÏÖÓÐÊý¾Ý¿â²úÆ·ÖÐÔËÐÐËÙ¶È×î¿ìµÄÊý¾Ý¿âϵͳ
4.Óû§È¨ÏÞÉèÖüòµ¥¡¢ÓÐ ......
mysqlÊǷdzּÌÁ¬½Óº¯Êý¶ømysqliÊÇÓÀÔ¶Á¬½Óº¯Êý¡£Ò²¾ÍÊÇ˵
mysqlÿ´ÎÁ´½Ó¶¼»á´ò¿ªÒ»¸öÁ¬½ÓµÄ½ø³Ì¶ømysqli¶à´ÎÔËÐÐmysqli½«Ê¹ÓÃͬһÁ¬½Ó½ø³Ì,´Ó¶ø¼õÉÙÁË·þÎñÆ÷µÄ¿ªÏú
ÓÐЩÅóÓÑÔÚ±à³ÌµÄʱºò£¬Ê¹ÓÃnew mysqli('localhost', usenamer', 'password', 'databasename');×ÜÊDZ¨´í£¬Fatal error: Class 'mysqli' not found in ......