查询网站whois,进行网站建设,做网站对企业的好处,云速建站与传统网站的区别启动mysql时显示#xff1a;/tmp/mysql.sock 不存在的解决方法启动mysql时显示#xff1a;/tmp/mysql.sock 不存在的解决方法启动mysql时报错的解决(mysql 5.0.45 redhat as43)启动mysql时报错的解决(mysql 5.0.45 redhat as 43)作者: lawzjf(http://lawzjf.itpub.net)发表于…启动mysql时显示/tmp/mysql.sock 不存在的解决方法启动mysql时显示/tmp/mysql.sock 不存在的解决方法启动mysql时报错的解决(mysql 5.0.45 redhat as43)启动mysql时报错的解决(mysql 5.0.45 redhat as 43)作者: lawzjf(http://lawzjf.itpub.net)发表于: 2008.01.13 01:29分类: 小企鹅出处: http://lawzjf.itpub.net/post/417/451262---------------------------------------------------------------启动mysql时报错Starting mysqld daemon with databases from/var/lib/mysqlSTOPPING server from pid file /var/run/mysqld/mysqld.pid071112 00:22:06 mysqld ended查看日志less /var/log/mysqld.log其中有一段如下071112 0:22:06 [ERROR] /usr/local/mysql/bin/mysqld: Cantcreate/write to file /var/run/mysqld/mysqld.pid (Errcode:2)071112 0:22:06 [ERROR] Cant start server: cant create PIDfile: No such file or directory071112 00:22:06 mysqld ended#cd /var/run/#lsmysqld目录不存在创建它#mkdir /var/run/mysqld#cd /var/run/mysqld创建文件mysqld.pid#touch mysqld.pid#cd..#chown -R mysql mysqld .#cd /usr/local/mysql/#bin/mysqld_safe --usermysql nohup: ignoring input and redirecting stderr to stdoutStarting mysqld daemon with databases from/var/lib/mysql能正常启动#bin/mysqladmin -u root password root又出错[rootlocalhost mysql]# bin/mysqladmin -u root passwordrootbin/mysqladmin: connect to server at localhost failederror: Cant connect to local MySQL server through socket/tmp/mysql.sock (2)Check that mysqld is running and that the socket:/tmp/mysql.sock exists![rootlocalhost mysql]# bin/mysql -u root -pEnter password:ERROR 2002 (HY000): Cant connect to local MySQL serverthrough socket /tmp/mysql.sock (2)分析是/tmp/mysql.sock 不存在# cd /var/lib/mysql/由于mysql 默认的mysql.sock是在/var/lib/mysql/mysql.sock创建符号连接# ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock# bin/mysql -u rootWelcome to the MySQL monitor. Commands end with ; or g.Your MySQL connection id is 1Server version: 5.0.45 MySQL Community Server (GPL)Type help; or h for help. Type c to clear thebuffer.mysql修改root 密码#cd /usr/local/mysql/#bin/mysqladmin -u root -p password yourpassword一切ok。