OK so at some point I borked my mysql 4.1.20 installation on my x86_64 system. Possibly relevant: I have enabled the centosplus repository in yum.conf because I needed a package from there. I have not upgraded mysql from there.
Everything was working, then "something" aparrently happened, and now mysql won't start. The logs say:
061031 11:37:38 mysqld started 061031 11:37:38 [ERROR] Can't start server : Bind on unix socket: Permission denied 061031 11:37:38 [ERROR] Do you already have another mysqld server running on socket: /var/lib/mysql/mysql.sock ? 061031 11:37:38 [ERROR] Aborting
061031 11:37:38 [Note] /usr/libexec/mysqld: Shutdown complete
Now the naive would presume that there is a permissions problem on /var/lib/mysql/mysql.sock, right? Certainly the web suggests that this is the problem.
[root@urquell2 ~]# ls -ld /var/lib/mysql/mysql.sock /var/lib/mysql ls: /var/lib/mysql/mysql.sock: No such file or directory drwxrwxr-x 4 mysql mysql 4096 Oct 31 11:39 /var/lib/mysql
Or maybe I'm trying to run mysql as the wrong user?
[root@urquell2 ~]# cat /etc/my.cnf [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock # Default to using old password format for compatibility with mysql 3.x # clients (those using the mysqlclient10 compatibility package). old_passwords=1
[mysql.server] user=mysql basedir=/var/lib
[mysqld_safe] err-log=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid
...so clearly mysql is trying to tell me something but can't use the right words to describe the problem.
In the highly unlikely event that someone knows what mysql is trying to say, can they tell me how I might fix this problem?
But more likely I would like to reinstall the RPMs since something is broke, right? Well that isn't so simple either.
[root@urquell2 ~]# rpm -e mysql error: "mysql" specifies multiple packages [root@urquell2 ~]# rpm -qa | grep mysql-4 mysql-4.1.20-1.RHEL4.1 mysql-4.1.20-1.RHEL4.1 [root@urquell2 ~]# rpm -e mysql-4.1.20-1.RHEL4.1 error: "mysql-4.1.20-1.RHEL4.1" specifies multiple packages
We are not even getting to the dependancy hell this will involve.
So how do I fix this problem? I'd rather not pave the system and start from scratch, but honestly if I'd done that the moment that this problem manifested, I'd probably be up and running again by now.
We are not even getting to the dependancy hell this will involve.
So how do I fix this problem? I'd rather not pave the system and start from scratch, but honestly if I'd done that the moment that this problem manifested, I'd probably be up and running again by now.
This sounds like you have both the i386 package and the x86_64 package installed.
create a .rpmmacros file in root's home directory with the contents -> %_query_all_fmt %%{name}-%%{version}-%%{release}.%%{arch}
then you can run your queries again. This should show that you have: mysql-4.1.20-1.RHEL4.1.i386 mysql-4.1.20-1.RHEL4.1.x86_64
You may also have the same thing for the server. I doubt very much it's a permissions file on the socket, as that's created when the app runs, although improper selinux permissions may cause problems. If the db doesn't contain any data, nuke all the mysql-* packages, and delete the /var/lib/mysql dir. Then install mysql-4.1.20-1.RHEL4.1.x86_64 and mysql-server-4.1.20-RHEL4.1.x86_64
Quoting Jim Perrin jperrin@gmail.com:
We are not even getting to the dependancy hell this will involve.
So how do I fix this problem? I'd rather not pave the system and start from scratch, but honestly if I'd done that the moment that this problem manifested, I'd probably be up and running again by now.
This sounds like you have both the i386 package and the x86_64 package installed.
For mysql package, that is perfectly OK. mysql.i386 has 32-bit libs, mysql.x86_64 has 64-bit libs.
/var/lib/mysql isn't part of mysql package. It's part of mysql-server package. Therefore, uninstalling mysql package isn't likely to fix anything. However, if David still wants to do it, the right option to use is --allmatches (as documented in rpm man page).
Now, before doing anything drastic. David, do you have SELinux running on the box? If so, is there anything logged in /var/log/messages when you attempt to start MySQL? Also, it'd be interesting to see output of "ls -lZd / /var /var/lib /var/lib/mysql".
On Tue, Oct 31, 2006 at 11:48:31AM -0600, Aleksandar Milivojevic wrote:
This sounds like you have both the i386 package and the x86_64 package installed.
For mysql package, that is perfectly OK. mysql.i386 has 32-bit libs, mysql.x86_64 has 64-bit libs.
/var/lib/mysql isn't part of mysql package. It's part of mysql-server package. Therefore, uninstalling mysql package isn't likely to fix anything. However, if David still wants to do it, the right option to use is --allmatches (as documented in rpm man page).
I got the RPMs uninstalled by specifying the full RPM spec, and using --nodeps:
# rpm -e --nodeps mysql-4.1.20-1.RHEL4.1.x86_64 mysql-4.1.20-1.RHEL4.1.i386 # rpm -e mysql-server-4.1.20-1.RHEL4.1.x86_64 # rpm -ivh mysql-server-4.1.20-1.RHEL4.1.x86_64.rpm mysql-4.1.20-1.RHEL4.1.x86_64.rpm
Now, before doing anything drastic. David, do you have SELinux running on the box? If so, is there anything logged in /var/log/messages when you attempt to start MySQL? Also, it'd be interesting to see output of "ls -lZd / /var /var/lib /var/lib/mysql".
According to the /etc/selinux/config file, selinux is disabled. This is confirmed by getenforce.
/var/log/messages shows little of interest:
Oct 31 12:45:40 urquell2 mysqld: Initializing MySQL database: succeeded Oct 31 12:46:11 urquell2 mysqld: Starting MySQL: failed
And the Z switch is obviously for selinux, so I'm not sure how interesting this is, but:
[root@urquell2 ~]# ls -ld / /var /var/lib /var/lib/mysql drwxrwx--- 32 cvs 500 4096 Oct 30 16:40 / drwxr-xr-x 25 root root 4096 Oct 13 06:57 /var drwxr-xr-x 30 root root 4096 Oct 31 13:00 /var/lib drwxr-xr-x 4 mysql mysql 4096 Oct 31 13:00 /var/lib/mysql
-- NOTICE: If you are not intended recipient, you are hereby notified that by reading this message you agreed not to disturb frogs during mating season. For more info, visit http://www.8-P.ca/
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Quoting David Mackintosh David.Mackintosh@xdroop.com:
[root@urquell2 ~]# ls -ld / /var /var/lib /var/lib/mysql drwxrwx--- 32 cvs 500 4096 Oct 30 16:40 /
# chmod 755 / # chown root:root /
BTW, what package were you installing from centosplus? If this wrecked permissions and ownership on root directory is result of a package from centosplus, than it needs fixing ASAP!
On Tue, Oct 31, 2006 at 12:22:50PM -0600, Aleksandar Milivojevic wrote:
Quoting David Mackintosh David.Mackintosh@xdroop.com:
[root@urquell2 ~]# ls -ld / /var /var/lib /var/lib/mysql drwxrwx--- 32 cvs 500 4096 Oct 30 16:40 /
# chmod 755 / # chown root:root /
Bingo. It starts now.
This is obviously the result of a bad rsync command I issued and then neglected to clean up properly. I'll doublecheck the rpms from centosplus, but I think this is a "finger problem" not a "repo problem".
Thank you -- I should have seen that rather than just blindly copying and pasting.
Quoting David Mackintosh David.Mackintosh@xdroop.com:
drwxrwx--- 32 cvs 500 4096 Oct 30 16:40 /
BTW, If I were you, I would recheck ownerships and permissions on the rest of your file system. To see if there is more damange (extremely likely). Searching for the files owned by cvs might be a good start (but it might not find all the damaged files). Something like "find / -user cvs".
Since you were removing packages with --nodeps, you might want to rpm -i that i386 mysql package, in case something on the system needs it. It is OK to have i386 and x86_64 version of mysql package installed in parallel.
On Tue, Oct 31, 2006 at 12:14:25PM -0500, Jim Perrin wrote:
So how do I fix this problem? I'd rather not pave the system and start from scratch, but honestly if I'd done that the moment that this problem manifested, I'd probably be up and running again by now.
This sounds like you have both the i386 package and the x86_64 package installed.
OK I have removed the mysql, the mysql-server, and the mysqlclient RPMs for both architectures, removed /var/lib/mysql, then reinstalled only the x86_64 versions. However I still have the startup problem, the log file shows the same error.
I thought of selinux too, but 'getenforce' shows selinux is Disabled.
Any other ideas?