LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Having problems installing MySQL on red hat 9. Cannot find mysql.sock (http://www.linuxquestions.org/questions/linux-newbie-8/having-problems-installing-mysql-on-red-hat-9-cannot-find-mysql-sock-645057/)

oferu 05-27-2008 08:22 AM

Having problems installing MySQL on red hat 9. Cannot find mysql.sock
 
Hi,

I previously wanted to upgrade MySQL but after receiving errors (mostly dependency errors) and realizing that my current MySQL version is the last tested version for the Red Hat 9 distribution, I finally decided to leave MySQL as is.
Unfortunately, while trying to install, I probably caused MySQL to no longer work properly. So I am trying to uninstall and reinstall but receiving errors.

//Checking which Mysql packages i need to uninstall
[oferu@localhost oferu]$ rpm - qa | grep -i mysql
perl-DBD-MySQL-2.1021-3
mysql-server-3.23.58-1.9
mysql-3.23.58-1.9

//Uninstall
[oferu@localhost oferu]$ rpm -e --nodeps perl-DBD-MySQL
[oferu@localhost oferu]$ rpm -e --nodeps mysql-server
[oferu@localhost oferu]$ rpm -e --nodeps mysql
[oferu@localhost oferu]$

//Now I have no mysql packages installed
[oferu@localhost /]$ rpm - qa | grep -i mysql
[oferu@localhost oferu]$

//Install (installing this way did not work)
[root@localhost forms]# apt-get install mysql
Reading Package Lists... Done
Building Dependency Tree... Done
The following extra packages will be installed:
perl-DBD-MySQL
The following NEW packages will be installed:
mysql perl-DBD-MySQL
0 upgraded, 2 newly installed, 0 removed and 2 not upgraded.
Need to get 185kB/6156kB of archives.
After unpacking 17.0MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Err http://ayo.freshrpms.net redhat/9/i386/os/ perl-DBD-MySQL 2.1021-3
404 Not Found
Failed to fetch http://ayo.freshrpms.net//redhat/9/i...021-3.i386.rpm 404 Not Found
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
[root@localhost forms]#

//Installing with rpms seems to work
//perl-DBD-MySQL - From the above (in bold) I looked for version 2.1021-3
[root@localhost temp]# rpm -i --nodeps perl-DBD-MySQL-2.1021-3.i386.rpm perl-DBD-MySQL-2.1021-3.i386.rpm
warning: package perl-DBD-MySQL = 2.1021-3 was already added, replacing with perl-DBD-MySQL <= 2.1021-3
[root@localhost temp]#

//mysql - (I am assuming that this is the mysql server package). I found that 3.23.58-1.9 is the latest stable version for red hat 9 distribution

[root@localhost temp]# rpm -i mysql-3.23.58-1.9.i386.rpm mysql-3.23.58-1.9.i386.rpm
warning: package mysql = 3.23.58-1.9 was already added, replacing with mysql <= 3.23.58-1.9
[root@localhost temp]#

//Installing MySQL-Client. I could not find the same version as the above //install (3.23.58-1.9). I hope 3.23.58-1 is close enough.
//Following did not work so added --force

[root@localhost temp]# rpm -i MySQL-client-3.23.58-1.i386.rpm MySQL-client-3.23.58-1.i386.rpm
warning: MySQL-client-3.23.58-1.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5
warning: package MySQL-client = 3.23.58-1 was already added, replacing with MySQL-client <= 3.23.58-1
file /usr/bin/mysql from install of MySQL-client-3.23.58-1 conflicts with file from package mysql-3.23.58-1.9
file /usr/bin/mysqlbinlog from install of MySQL-client-3.23.58-1 conflicts with file from package mysql-3.23.58-1.9
file /usr/bin/mysqlcheck from install of MySQL-client-3.23.58-1 conflicts with file from package mysql-3.23.58-1.9
file /usr/bin/mysqldump from install of MySQL-client-3.23.58-1 conflicts with file from package mysql-3.23.58-1.9
file /usr/bin/mysqlimport from install of MySQL-client-3.23.58-1 conflicts with file from package mysql-3.23.58-1.9
file /usr/bin/mysqlshow from install of MySQL-client-3.23.58-1 conflicts with file from package mysql-3.23.58-1.9
file /usr/share/man/man1/mysql.1.gz from install of MySQL-client-3.23.58-1 conflicts with file from package mysql-3.23.58-1.9
file /usr/share/man/man1/mysqlaccess.1.gz from install of MySQL-client-3.23.58-1 conflicts with file from package mysql-3.23.58-1.9
file /usr/share/man/man1/mysqladmin.1.gz from install of MySQL-client-3.23.58-1 conflicts with file from package mysql-3.23.58-1.9
file /usr/share/man/man1/mysqldump.1.gz from install of MySQL-client-3.23.58-1 conflicts with file from package mysql-3.23.58-1.9
file /usr/share/man/man1/mysqlshow.1.gz from install of MySQL-client-3.23.58-1 conflicts with file from package mysql-3.23.58-1.9


//With --force seemed to work
[root@localhost temp]# rpm -i --force MySQL-client-3.23.58-1.i386.rpm MySQL-client-3.23.58-1.i386.rpm
warning: MySQL-client-3.23.58-1.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5
warning: package MySQL-client = 3.23.58-1 was already added, replacing with MySQL-client <= 3.23.58-1
[root@localhost temp]#

//Now I have new packages installed
[oferu@localhost /]$ rpm - qa | grep -i mysql
MySQL-client-3.23.58-1
mysql-3.23.58-1.9
perl-DBD-MySQL-2.1021-3
[oferu@localhost /]$

//My question - Trying to run MySQL - I am receiving an error
[root@localhost /]# mysql
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[root@localhost /]#


//I have no file named mysql.sock anywhere (fn is a search alias)
[root@localhost /]# fn sock | grep -i mysql
./usr/local/mysql-4.1.5-gamma/libmysql_r/viosocket.c
./usr/local/mysql-4.1.5-gamma/libmysql/.deps/viosocket.Plo
./usr/local/mysql-4.1.5-gamma/libmysql/viosocket.c
./usr/local/mysql-4.1.5-gamma/libmysql/.libs/viosocket.o
./usr/local/mysql-4.1.5-gamma/libmysql/viosocket.o
./usr/local/mysql-4.1.5-gamma/libmysql/viosocket.lo
./usr/local/mysql-4.1.5-gamma/ndb/src/common/util/socket_io.cpp
./usr/local/mysql-4.1.5-gamma/ndb/include/util/socket_io.h
./usr/local/mysql-4.1.5-gamma/vio/viosocket.c
./usr/local/mysql-4.1.5-gamma/vio/.deps/viosocket.Po
./usr/local/mysql-4.1.5-gamma/vio/viosocket.o
[root@localhost /]#

In addition, although it seems I have re-installed mysql:
/sbin/service mysql start
mysql: unrecognized service

Can someone help with this error message?

Thanks,
Ofer

acid_kewpie 05-27-2008 08:28 AM

Please scroll down to the bottom of this page for a nmber of identical issues. Please try searching this site and google in future for very common errors like this.

in short... you've not got the mysql service even running.

bigrigdriver 05-27-2008 08:31 AM

You need to start the mysql server before you can log in to mysql. Try '/usr/bin/mysqld_safe' then try 'mysql' to start the client.

chrism01 05-27-2008 07:13 PM

Assuming that really is RH9, not RH Fedora 9 (which appears to be the case), that hasn't been supported/updated since 2004(?).
You'd be much more secure and less stress if you upgraded to a current distro eg See RH Fedora or Centos.


All times are GMT -5. The time now is 08:42 AM.