Quantcast
Channel: MySQL Forums - Install & Repo
Viewing all articles
Browse latest Browse all 7239

mysql.sock is missing (1 reply)

$
0
0
Hi,

initially I have mysql working, however I wanted to move the data files to another partition/filesystem, i.e. I decided to move from /var/lib/mysql to /mysql_data/mysql.

so I decided to move the datafiles as it is stated in http://www.kaliphonia.com/content/linux/how-to-move-mysql-datadir-to-another-drive

so here's my directory listing of old location /var/lib/mysql/

[root@localhost mysqldump]# ls -lrth /var/lib/mysql/
total 21M
drwx------ 2 mysql mysql 4.0K Aug 18  2009 test
drwx------ 2 mysql mysql 4.0K Aug 18  2009 mysql
drwx------ 2 mysql mysql 4.0K Aug 19  2009 employees
-rw-rw---- 1 mysql mysql 5.0M Jul 22 21:35 ib_logfile1
drwx------ 2 mysql mysql 4.0K Jul 23 22:19 xtreme3_db
drwx------ 2 mysql mysql 4.0K Jul 23 22:46 ownblog
-rw-rw---- 1 mysql mysql 5.0M Jul 24 01:01 ib_logfile0
-rw-rw---- 1 mysql mysql  10M Jul 24 01:01 ibdata1
lrwxrwxrwx 1 root  root    11 Jul 24 23:50 mysql_data -> /mysql_data

so here's my directory listing of new location /mysql_data/mysql
[root@localhost mysqldump]# ls -lrth /mysql_data/mysql
total 21M
drwx------ 2 mysql mysql 4.0K Aug 18  2009 test
drwx------ 2 mysql mysql 4.0K Aug 18  2009 mysql
drwx------ 2 mysql mysql 4.0K Aug 19  2009 employees
drwx------ 2 mysql mysql 4.0K Jul 22 22:26 xtreme3_db
-rw-rw---- 1 mysql mysql 5.0M Jul 24 23:00 ib_logfile1
-rw-rw---- 1 mysql mysql  10M Jul 24 23:54 ibdata1
srwxrwxrwx 1 mysql mysql    0 Jul 24 23:57 mysql.sock
-rw-rw---- 1 mysql mysql 5.0M Jul 24 23:57 ib_logfile0

when I try to connect
[root@localhost ~]# mysql -u root -p -D ownblog -h localhost
Enter password: 
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
this is really strange because socket should not begin from the old directory in the first place
I also confirmed that mysqld is running

[root@localhost mysqldump]# /etc/init.d/mysqld status
mysqld (pid 4917) is running...
[root@localhost mysqldump]#
here's the listing of my latest etc/my.cnf

[mysqld]
datadir=/mysql_data/mysql
socket=/mysql_data/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
as the content in /etc/init.d/mysqld is very large, I only post the relevant portion
get_mysql_option mysqld datadir "/mysql_data/mysql"
datadir="$result"

my linux distro is

[root@localhost mysqldump]# more /etc/issue
CentOS release 5.5 (Final)
Kernel \r on an \m

[root@localhost mysqldump]#

mysql version is

Installed Packages
Name       : mysql
Arch       : i386
Version    : 5.0.77
Release    : 4.el5_5.3
Size       : 7.9 M
Repo       : installed
Summary    : MySQL client programs and shared libraries.
URL        : http://www.mysql.com
License    : GPLv2 with exceptions
Description: MySQL is a multi-user, multi-threaded SQL database server. MySQL is
           : a client/server implementation consisting of a server daemon
           : (mysqld) and many different client programs and libraries. The base
           : package contains the MySQL client programs, the client shared
so May I know how should I resolve the above situation?

thanks

Viewing all articles
Browse latest Browse all 7239

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>