Ô¶³Ì×ÀÃæÒ»Á¬½Ó£¬Ô¶³Ìmysql·þÎñÆ÷¾ÍÁ¬²»ÉÏ
ÎÒÓõÄÁ½Ì¨·þÎñÆ÷£¬¶¼ÊÇwin2003µÄ£¬ÆäÖÐһ̨װPHP£¬Áíһ̨װMYSQL×öÊý¾Ý¿â£¬ÔÚͬһ¸öÍø¶ÎÄÚ
ƽʱÔËÐÐûÓÐÎÊÌ⣬µ±ÎÒÓÃ×Ô¼ºµçÄÔÔ¶³Ì×ÀÃæÒ»Á¬½ÓMYSQLÊý¾Ý¿âÄÇ̨·þÎñÆ÷£¬PHP¾ÍÏÔʾ¡°can't connect MYSQL server¡±£¬Õâµ½µ×ÊÇΪʲô°¡£¿ÔõôҲÏ벻ͨ
¹À¼Æ»¹ÊÇÊÚÓèȨµÄÎÊÌâ¡£
3. ȨÏÞµÄÎÊÌâ £¬mysql µÄȨÏÞÉèÖÃÖÐÓû§µÄÕ˺ÅÓÉ username@hostname Á½²¿·Ö×é³É£¬ aaaa@localhost ºÍ aaaa@www.csdn.net ¶ÔMYSQLÀ´Ëµ²¢²»ÊÇͬһ¸öÓû§ÊÚȨ£¡,ÏÈÊÔ×Å
grant all on *.* to root@%;
È»ºóÔÙÁ¬Ò»ÏÂÊÔÊÔ
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
²éѯmysql¿âÀïuser±í¶ÔÓ¦µÄhostÊÇ·ñ°üº¬ÄãµçÄÔµÄIP(%Ϊ²»ÏÞÖÆIPÔÊÐíÔ¶³ÌÁ¬½Ó)¡£
SQL code:
mysql> use mysql
Database changed
mysql> select host,user from user;
+-----------+-------+
| host | user |
+-----------+-------+
| % | model |
| % | scot |
| localhost | root |
+-----------+-------+
3 rows in set (0.00 sec)
¿´¿´user¶ÔÓ¦µÄhost
Â¥Éϼ¸Î»¿ÉÄÜÎó»áµÄÒâ˼ÁË£¬ÎÒÊÇÁ½Ì¨·þÎñÆ÷AºÍB£¬Æ½Ê±ÔËÐÐÕý³££¬Ò²¾ÍÊÇȨÏÞûÎÊÌ⣻¶øµ±ÎÒÓÃ×Ô¼ºµÄµçÄÔC,È¥Ô¶³Ì×ÀÃæÁ¬½ÓB£¬Õâʱ£¬A¾ÍÁ¬²»ÉÏBµÄMYSQL·þÎñÆ÷ÁË
Óû§ Ö÷»ú ÀàÐÍ È¨ÏÞ ÊÚȨ ²Ù×÷
root % È«¾Ö ALL PRIVILEGES ÊÇ
root localhost È«¾Ö ALL PRIVILEGES ÊÇ
°¥£¬Óô
Ïà¹ØÎÊ´ð£º
Ò»¸öÐÐÒµÍøÕ¾£¬ÒªÊµÏֵŦÄÜÒªÇóΪ£º
Ò»ËÑË÷±íµ¥¿ÉÑ¡ËÑË÷ ²úÆ·/×ÊѶ/É̼ң¬ËÑË÷ʱϣÍûÏÈËѱêÌâºóÈ«ÎÄ£¬µ±Ç°µÄÊý¾ÝÁ¿¹À¼Æ3Íò¶à£¬¶¨Î»ÆÚÍûÔÚ°ÙÍò¼¶Ò²¿ÉÓá£
Êý¾ÝÀàÐÍΪinnodb£¬µ±Ç°µÄ·½·¨ÊǶԹؼü´Ê½øÐÐ ......
ÎÒ֮ǰµ¼ÈëµÄÊý¾Ý¿â£¬ÏÖÔÚɾ³ý²»ÁË£¬ÓÃÁËÃüÁîÐк͹¤¾ß¶¼²»ÐУ¬ÖØÆôÒ²²»ÐУ¬ÕâÊÇΪʲôÄØ£¿
ÄãÊÇÈçºÎɾ³ýµÄ£¿
ÓÐʲôÌáʾ£¿
ÎÊÌâ˵Ã÷Ô½Ïêϸ£¬»Ø´ðÒ²»áԽ׼ȷ£¡²Î¼ûÈçºÎÌáÎÊ¡££¨ÌáÎʵÄÖǻۣ©
......
ÎÒÒÔÇ°°²×°ÁËÒ»´Î£¬ºóÀ´Ð¶ÔØÁË£¬ÏÖÔÚÔÙ°²×°µÄʱºò£¬Ìáʾ´íÎó£ºError 1305.Error reading from file C:DOCUME~1\LOCALS~1\Temp\mysql_server.msi.Verify that the file exists and that you can access it.
¿ ......
ÎÒÏÖÔÚѧϰMYSQL£¬ÎÊÏÂmysql´¢´æ¹ý³ÌÈçºÎ½¨Á¢ºÍʹÓã¬×îºÃд³É$sql="sqlÓï¾ä",$re=mysql_query($sql);лл
½¨ÒéÄãÏÈ×Ô¼º¿´Ò»ÏÂÎĵµÖеÄÀý×Ó¡£
http://dev.mysql.com/doc/refman/5.1/zh/stored-pro ......
ÓÐÁ½ÕÅ±í£º¹«Ë¾±ícompany(id,name...)£¬ºÏͬ±íhetong(id,title,companyid,type...)
Ò»¸ö¹«Ë¾¿ÉÄÜÓж೤ºÏͬ£¬typeΪ1-10µÇ¼Ç
ÀýÈ磺company±í
id ......