我在solari10上架设apache2.2.4+php5.2.3+mysql5.0.41网站开发平台安装mysql时遇到了不能连接mysql,下面是安装过程,和出错信息,新手上路,请多多指点。Installation of <SMCmysql> was successful.# #
# cd /usr/local
# chown -R root mysql
# chgrp -R mysql mysql
# cd /usr/local/mysql/bin
# ./mysql_install_db --user=mysql&
7218
# Installing MySQL system tables...
OK
Filling help tables...
OKTo start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your systemPLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/local/mysql/bin/mysqladmin -u root password 'new-password'
/usr/local/mysql/bin/mysqladmin -u root -h ncpilot password 'new-password'
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe &You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.plPlease report any problems with the /usr/local/mysql/bin/mysqlbug script!The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com# ./mysqld_safe --user=root&
7272
# Starting mysqld daemon with databases from /usr/local/mysql/var
STOPPING server from pid file /usr/local/mysql/var/ncpilot.pid
070820 22:18:05  mysqld ended./mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
# ./mysqld_safe --user=mysql&
7297
# Starting mysqld daemon with databases from /usr/local/mysql/var
STOPPING server from pid file /usr/local/mysql/var/ncpilot.pid
070820 22:19:43  mysqld ended./mysqld_safe --user=root &
7321
# Starting mysqld daemon with databases from /usr/local/mysql/var
STOPPING server from pid file /usr/local/mysql/var/ncpilot.pid
070820 22:20:11  mysqld ended
# ./mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

解决方案 »

  1.   

    ERROR   2002   (HY000):   Can "t   connect   to   local   MySQL   server   through   socket   "/tmp/mysql.sock "   (2) 去GOOGLE搜索一下。这个问题问的太多了。
      

  2.   

    http://www.google.cn/search?complete=1&hl=zh-CN&ie=GB2312&q=Can+%22t+++connect+++to+++local+++MySQL+++server+++through+++socket+++%22%2Ftmp%2Fmysql.sock+%22&btnG=Google+%CB%D1%CB%F7&meta=&aq=null