首页 技术 正文
技术 2022年11月21日
0 收藏 541 点赞 4,314 浏览 1807 个字

启动mysql时显示:/tmp/mysql.sock 不存在的解决方法


启动mysql时报错的解决(mysql 5.0.45 redhat as
43) =========================================================== 启动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: Can’t
create/write to file ‘/var/run/mysqld/mysqld.pid’ (Errcode:
2)071112 0:22:06 [ERROR] Can’t start server: can’t create PID
file: 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 –user=mysql &nohup: ignoring input and redirecting stderr to stdoutStarting mysqld daemon with databases from
/var/lib/mysql能正常启动#bin/mysqladmin -u root password root又出错[root@localhost mysql]# bin/mysqladmin -u root password
rootbin/mysqladmin: connect to server at ‘localhost’ failederror: ‘Can’t connect to local MySQL server through socket
‘/tmp/mysql.sock’ (2)’Check that mysqld is running and that the socket:
‘/tmp/mysql.sock’ exists![root@localhost mysql]# bin/mysql -u root -pEnter password:ERROR 2002 (HY000): Can’t connect to local MySQL server
through 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 the
buffer.mysql>修改root 密码#cd /usr/local/mysql/#bin/mysqladmin -u root -p password yourpassword一切ok。

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,074
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,551
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,399
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,176
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,811
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,892