ERROR 2002: Can't connect to local MySQL server through socket '/tmp/tmp/mysql.sock' (2)

来源:互联网 发布:seo代理 编辑:程序博客网 时间:2024/04/28 13:50
 
 
Mysql错误日志:
070718 14:58:03 mysqld started
070718 14:58:04 Can't start server : Bind on unix socket: Permission denied
070718 14:58:04 Do you already have another mysqld server running on socket: /tmp/mysql.sock ?
070718 14:58:04 Aborting
 
070718 14:58:05 /usr/local/mysql/libexec/mysqld: Shutdown Complete
 
070718 14:58:05 mysqld ended
 
服务期下的显示:
 [root@192 root]# mysql
ERROR 2002: Can't connect to local MySQL server through socket '/tmp/tmp/mysql.sock' (2)
 [root@192 bin]# ps -Af | grep mysql //查看mysql进程
root      1026   656 0 17:13 pts/0    00:00:00 grep mysql
[root@192 bin]# mysql
ERROR 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
[root@192 bin]# chown -R mysql:mysql /usr/local/mysql/lib/mysql
 [root@192 bin]# chmod 755 /usr/local/mysql/var
//启动mysql。。失败
 [root@192 bin]# /usr/local/mysql/share/mysql/mysql.server start
[root@192 bin]# Starting mysqld daemon with databases from /usr/local/mysql/var
070718 17:31:58 mysqld ended
 
//依然有问题
[root@192 bin]# mysql
ERROR 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
[root@192 bin]# /usr/local/mysql/share/mysql/mysql.server start
[root@192 bin]# Starting mysqld daemon with databases from /usr/local/mysql/var
070718 17:32:40 mysqld ended
//用用户mysql登录
[root@192 bin]# chown -R mysql:mysql /usr/local/mysql/var
[root@192 bin]# su mysql
[mysql@192 bin]$ /usr/local/mysql/share/mysql/mysql.server start
[mysql@192 bin]$ Starting mysqld daemon with databases from /usr/local/mysql/var
rm: 无法删除‘/tmp/mysql.sock’: 权限不够
070718 17:34:55 mysqld ended
没有权限启动
 
[mysql@192 bin]$ su root
Password:
[root@192 bin]# cd /tmp
[root@192 tmp]# ls -a
.                      
[root@192 tmp]# ls -l
总用量 212
drwx------    2 root     root         4096 5月 23 20:46 ksocket-root
drwx------    2 root     root        16384 2006-08-20 lost+found
drwx------    2 root     root         4096 5月 23 20:00 mcop-root
drwx------    2 root     root         4096 5月 23 20:50 orbit-root
-rw-------    1 nobody   nobody          0 7月 18 14:22 sess_0acd9456417a7236879549c0755393f0
-rw-------    1 nobody   nobody          0 7月 18 14:10 sess_313078a25b2c2d4e12c497e8e88d9351
-rw-------    1 nobody   nobody         42 7月 18 14:50 sess_79b1515bb76f5de7b1b937d61292e5d6
-rw-------    1 nobody   nobody          0 7月 18 14:52 sess_c0463bdb206518b303499be715fb5728
-rw-------    1 nobody   nobody      16418 7月 18 14:52 sess_c91000d32958b258b58aa99408f43cad
-rw-------    1 nobody   nobody          0 7月 18 13:57 sess_cc7efc75c67535fb2126eb9e092b6e85
-rw-------    1 nobody   nobody          0 7月 18 14:23 sess_d995f248efa635168da1bc8c1ff53055
-rw-------    1 nobody   nobody          0 7月 18 13:52 sess_debbfbd6b05635bf0b8d3145e2f75ea9
-rw-------    1 nobody   nobody         42 7月 18 14:52 sess_f642bfdbe68b9a3366da72c971b7ba7a
drwx------    2 root     root         4096 5月 24 08:58 ssh-XX1JBW8A
drwx------    2 root     root         4096 7月 18 09:01 ssh-XX5ggGsG
drwx------    2 root     root         4096 7月 18 14:57 ssh-XX5Pr9zq
drwx------    2 root     root         4096 6月 26 09:08 ssh-XX61KRuw
drwx------    2 root     root         4096 7月 18 15:04 ssh-XX659KWB
drwx------    2 root     root         4096 6月 25 13:47 ssh-XX7YHh1d
drwx------    2 root     root         4096 7月 18 16:31 ssh-XX928wQg
drwx------    2 root     root         4096 7月 9 10:22 ssh-XXAvqw5z
drwx------    2 root     root         4096 5月 7 15:12 ssh-XXbZmiKU
drwx------    2 root     root         4096 7月 18 15:16 ssh-XXdeWXLo
drwx------    2 root     root         4096 7月 10 18:21 ssh-XXFapSwp
drwx------    2 root     root         4096 5月 23 20:00 ssh-XXfDKhWv
drwx------    2 root     root         4096 7月 10 13:37 ssh-XXj3HRLJ
drwx------    2 root     root         4096 6月 7 09:07 ssh-XXJ4r1QY
drwx------    2 root     root         4096 6月 25 10:01 ssh-XXKFvHyV
drwx------    2 root     root         4096 5月 25 08:54 ssh-XXkwcTRB
drwx------    2 root     root         4096 6月 12 12:50 ssh-XXm3EjrT
drwx------    2 root     root         4096 7月 18 16:09 ssh-XXmEK1Fk
drwx------    2 root     root         4096 7月 18 15:38 ssh-XXNisqHv
drwx------    2 root     root         4096 6月 25 12:50 ssh-XXoaM1af
drwx------    2 root     root         4096 6月 25 09:15 ssh-XXoDhuck
drwx------    2 root     root         4096 5月 30 09:04 ssh-XXoG1p08
drwx------    2 root     root         4096 6月 12 13:31 ssh-XXOSdHnC
drwx------    2 root     root         4096 7月 18 16:44 ssh-XXpRyubb
drwx------    2 root     root         4096 6月 27 16:42 ssh-XXpsQDOq
drwx------    2 root     root         4096 7月 18 16:02 ssh-XXqRRvTe
drwx------    2 root     root         4096 6月 25 09:17 ssh-XXrHpbyw
drwx------    2 root     root         4096 7月 18 15:05 ssh-XXROZybt
drwx------    2 root     root         4096 5月 8 09:08 ssh-XXRTer2c
drwx------    2 root     root         4096 7月 18 17:09 ssh-XXTizJAD
drwx------    2 root     root         4096 6月 26 16:21 ssh-XXtOVFak
drwx------    2 root     root         4096 7月 4 12:45 ssh-XXTs6yvC
drwx------    2 root     root         4096 2006-08-21 ssh-XXu5KFwi
drwx------    2 root     root         4096 6月 25 10:22 ssh-XXUp7fVA
drwx------    2 root     root         4096 5月 18 19:21 ssh-XXVT2yAa
drwx------    2 root     root         4096 7月 9 10:09 ssh-XXXUywyU
drwx------    2 root     root         4096 7月 10 18:31 ssh-XXy3NXI7
drwx------    2 root     root         4096 7月 18 17:10 ssh-XXyGNRGK
drwxrwxrwx    2 root     root         4096 7月 18 17:05 tmp
[mysql@192 tmp]$ mysql
ERROR 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (13)
[mysql@192 tmp]$ su root
Password:
 
 [root@192 tmp]# ps -aux | grep mysql
mysql     1382 0.0 0.2 5544 1376 pts/0    S    17:34   0:00 bash
mysql     1475 0.0 0.2 5552 1388 pts/0    S    17:38   0:00 bash
[root@192 tmp]# chown -R mysql:mysql /usr/local/mysql/
[root@192 tmp]# /usr/local/mysql/share/mysql/mysql.server start
[root@192 tmp]# Starting mysqld daemon with databases from /usr/local/mysql/var
070718 17:41:36 mysqld ended
//问题依然
//把‘/tmp/mysql.sock’的权限修改成777后
 [root@192 bin]# mysql
ERROR 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
[root@192 bin]# su mysql
[mysql@192 bin]$ /usr/local/mysql/share/mysql/mysql.server start
[mysql@192 bin]$ Starting mysqld daemon with databases from /usr/local/mysql/var
[mysql@192 bin]$ mysql
Welcome to the MySQL monitor. Commands end with ; or /g.
Your MySQL connection id is 1 to server version: 3.23.56-log
 
Type 'help;' or '/h' for help. Type '/c' to clear the buffer.
 
mysql> exit
Bye
[mysql@192 bin]$ su root
Password:
[root@192 bin]# mysql
Welcome to the MySQL monitor. Commands end with ; or /g.
Your MySQL connection id is 27 to server version: 3.23.56-log
 
Type 'help;' or '/h' for help. Type '/c' to clear the buffer.
 
mysql>
o(∩_∩)o…哈哈!!
Ok了
 
原创粉丝点击