MySQL Community Server 5.1.54 on openSUSE 11.1 (SLES 11 sp1) Error 2003 /var/lib/mysql.sock

Yesterday MySQL stopped working on my server. I can’t connect remotely, at the command line or locally.

I’ve tried using localhost which returns the error can’t create /var/lib/mysql/mysql.sock

I’ve tried using 127.0.0.1 which returns the error 2003 (Can’t connect to MySQL server on 127.0.0.1 (111)

I’ve tried installing MySQL 5.0.67 and removing MySQL Community Server. I’ve also tried updating to 5.1.30 and no matter what I do I can’t establish a connection.

When I check restart the server (sudo /etc/init.d/mysql restart) The server shuts down and restarts but gives the error that /var/lib/mysql/mysql.sock could not be created in 30 seconds.

Any help would be appreciated. Where do I go from here? This is a server at my college and I’m just taking over as admin for the box. The /etc/my.cnf is correct and has the socket = /var/lib/mysql/mysql.sock

Wrong forum if this is a SLES 11 sp1 server. You want:
http://forums.opensuse.org/archive/index.php/

Check the file permissions for /var/lib/mysql and make sure that the owner of the mysql daemon has write and execute access. Delete any existing socket while mysql is stopped, and then restart.

I ran

chown -R /var/lib/mysql mysql
chgrp -R /var/lib/mysql mysql

Still can’t connect.

How do I delete the existing socket while mysql is stopped?

You are in the wrong forum if you have a SLES 11 sp1 server. You want:
http://forums.opensuse.org/archive/index.php/
anything in this forum would have to be translated. Few here have much experience of SLES

Checking the permissions on a directory requires looking at the output of e.g. ls -lhd /var/lib/mysql; not blindly changing the ownership recursively.

If you fail to provide sufficient information to understand your problem, you will discourage people from trying to assist.

If you have openSuSE-11.1 it is a long time out of maintenance and should be upgraded to 11.4 if you want any security and the chance of useful support.
In openSuSE:
The mysql daemon is controlled whith the rcmysql stop|start|restart|reload command.
The socket and pid lock files are normally in /var/run/mysql
When mysql is stopped/running

alessia:~ # rcmysql stop
Shutting down service MySQL                             done
alessia:~ # l /var/run/mysql/
total 5.0K
drwxr-xr-x  2 mysql mysql   72 Sep 23 17:18 ./
drwxr-xr-x 30 root  root  1.4K Sep 22 13:29 ../
-rw-r--r--  1 root  root    22 Sep 23 17:18 tmpdir
alessia:~ # rcmysql start
Starting service MySQL                                  done
alessia:~ # l /var/run/mysql/
total 9.0K
drwxr-xr-x  2 mysql mysql  136 Sep 23 17:18 ./
drwxr-xr-x 30 root  root  1.4K Sep 22 13:29 ../
srwxrwxrwx  1 mysql mysql    0 Sep 23 17:18 mysql.sock=
-rw-rw-r--  1 mysql mysql    6 Sep 23 17:18 mysqld.pid
-rw-r--r--  1 root  root    22 Sep 23 17:18 tmpdir
alessia:~ # 

delete an orphan socket or pid with e.g.:
rm /var/run/mysql/mysql.sock

From a standard /etc/my.conf

# The MySQL server
[mysqld]
port            = 3306
socket        = /var /run/mysql/mysql.sock
pid-file         = /var/run/mysql/mysql.pid

Only if you are running mysqld_multi does the default place the socket and pid files in the data directory; although I prefer then in /var/run/mysqld[1-n]

On 09/23/2011 05:06 PM, jsw1130 wrote:

> Any help would be appreciated. Where do I go from here? This is a
> server at my college and I’m just taking over as admin for the box.

you are of course welcome to hang out here and see if someone has a good
answer for you…but, be advised that most (almost all?) have never run
SLES 11…and, while there is kinship between the two, SLES and
openSUSE are absolutely NOT identical twins…

using the enterprise version you will most likely get the
best answer over in http://tinyurl.com/422mrnu

the ID/Pass you used here also works over there…

anyway, as SLES is commercial/enterprise software you are probably
paying a fee for just the kind of support you are seeking here…you
should look for it at the correct place.

you might consider loading openSUSE on your own computer and thereby
become more familiar with admin duties for a commercial server…


DD
openSUSE®, the “German Automobiles” of operating systems

Thanks, When I go to http://forums.opensuse.org/archive/index.php/ I get the same forums I’m in. ??? I sincerely searched around looking for the correct place. I apologize if I come off looking like an idiot. I’m fairly new to the world of linux administration. I’m not a complete n00b but I definitely put myself in the inexperienced category.

I do plan on upgrading this server to 11.4 in the next month or so. The problem is, it’s a student server for the CS department and I’m new guy on the block as of two weeks ago. The college IT staff have washed their hands of it and the last two admins didn’t do anything but let students beat it up.

So long story but you get the idea. I ask humbly for assistance from those that know much more than I.

The output of **ls -lhd /var/lib/mysql **

/var/lib/mysql$ ls -lhd /var/lib/mysql
drwxr-xr-x 23 mysql mysql 4.0K 2011-09-23 10:55 /var/lib/mysql

I can shut down the service but when I tried to restart I get this error every time.

/var/lib/mysql$ sudo /etc/init.d/mysql start
Will update MySQL now, if you encounter any problems, please read following file:
        /usr/share/doc/packages/mysql-community-server/README.SuSE
Log files inconsistency, please merge following files manually:
        /var/lib/mysql/mysqld.log
        /var/log/mysqld.log
Running protected MySQL...
error: /var/tmp/mysql-protected.JiUX4s/mysql.sock file didn't appeared...
       Try checking "/var/log/mysql/mysqld-upgrade-run.log"...
                                                                     failed

This started after I updated the broken repo http://download.opensuse.org/repositories/server:/database:/mysql51/openSUSE_11.1/ to Index of /repositories/server:/database:/UNSTABLE/SLE_11_SP1

At which point I tried changing from MySQL 5.0.67 to MySQL Community Server 5.1.54 to see if that would fix the 2003 error. I did check the log files and the shared library files are erring out with No such file or directory.

110922 19:21:01 [ERROR] Can't open shared library '/usr/lib/mysql/plugin/ha_example.so' (errno: 0 cannot open shared object file: No such file or directory)
110922 19:21:01 [Warning] Couldn't load plugin named 'EXAMPLE' with soname 'ha_example.so'.
110922 19:21:01 [ERROR] /usr/sbin/mysqld: unknown option '--skip-federated'
110922 19:21:01 [ERROR] Aborting

Thanks again for any assistance the forum members can lend.

Sorry if the title of the post is confusing. This is openSUSE 11.1. It is free. I checked for support and I was told this server isn’t eligible for support for several reasons. a) it’s OES. b) it’s too old and out of life cycle.

which leads me to ask for assistance from the forums.

OS:  Linux 2.6.27.56-0.1-pae i686
  Current user:  jsw1130@hydra
  System:  openSUSE 11.1 (i586)
  KDE:  3.5.10 "release 21.13.1"

On 09/23/2011 07:46 PM, jsw1130 wrote:
> OS: Linux 2.6.27.56-0.1-pae i686
> Current user: jsw1130@hydra
> System: openSUSE 11.1 (i586)
> KDE: 3.5.10 “release 21.13.1”

ok! you are in the right place…unfortunately, the 11.1 is past its end
of life and therefore no longer receiving security updates…but, those
can be restored by joining the Evergreen Project
<http://tinyurl.com/4aflkpy>, but if the hardware has the horsepower
<http://en.opensuse.org/Hardware_requirements> i’d sure recommend you
upgrade as soon as you can, if there is anything of import therein, OR
it is connected to the internet and can be script-kiddie hacked and
turned into a botnet control node (which may by why MySQL no longer
works–it was using too many cycles the new powners wanted to use
selling organ extending pills…

hmmmm…i read: “it’s a student server for the CS department” and i
don’t know what that means…does it serve up something to the
students? (mail, test questions, storage space, what?) or is it just a
place for them to practice stuff at the terminal (mv, rm, cp, and all
the others which are different from (say) DOS)…

and, “The college IT staff have washed their hands of it” does that mean
they only teach MS server now?

oh, btw i have NO idea how to solve your problem…but there are some
folks here who do…unfortunately most of them won’t read a SLES (in the
subject line) message…i’ll send a private message to a few i think
might can actually help, asking them to look in…but still they may
not want to help restart an out of support system…(which may be so
broken from “students beat it up” that it may never breathe again until
… . .


DD
openSUSE®, the “German Automobiles” of operating systems

On Fri, 23 Sep 2011 17:46:02 +0000, jsw1130 wrote:

> Sorry if the title of the post is confusing. This is openSUSE 11.1. It
> is free. I checked for support and I was told this server isn’t eligible
> for support for several reasons. a) it’s OES. b) it’s too old and out of
> life cycle.

Just a point of clarification, it’s not OES - OES is Novell’s “Open
Enterprise Server” product, which is based on SLES. :slight_smile:

As others have pointed out openSUSE 11.1 is out of general support as
well - that doesn’t mean nobody can/will help you, but if an update is
necessary to fix the issue, there won’t be any that were built after 11.1
left general support.

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

I think it would be a good idea to backup the entire database(s) with ‘mysqldump’ first. As DenverD mentioned, you should give us some context as to what is the server used for. Do you have permission to upgrade it? Ideally, upgrade the OS to 11.4 (or some other version that is supported).

I hate to give you bad news but you’ve gone about the wrong way. You should have asked before attempting the upgrade.

  1. You should have made a dump of the database before starting.

  2. openSUSE and SLES are different products. You would get into trouble using packages for another product.

  3. openSUSE 11.1 and 11.4 differ sufficiently that they should be regarded as different products where packages are concerned.

  4. Locations of files have moved in MySQL versions giving you the missing socket problem.

The safest way to update is to make a dump of the database and restore on a more recent release. Can you restore the system back to the way it was before the upgrade and start over again, or have you burnt your bridges?

Some unsorted ideas what you can try:

  1. Backup your database files. Provided they are intact someone with a working 11.1 can make dumps from them.

  2. Uninstall any incompatible MySQL packages you have installed.

  3. Look here: openSUSE:Evergreen - openSUSE
    11.1 is still maintained in the Evergreen project. Install MySQL from the Evergreen repos.

On 2011-09-23 19:36, jsw1130 wrote:
> This started after I updated the broken repo
> http://tinyurl.com/3lnazgx to ‘Index of
> /repositories/server:/database:/UNSTABLE/SLE_11_SP1’
> (http://tinyurl.com/439agyg)

You said elsewhere that you are using openSUSE, not SLES, thus you used the
wrong repo to update it. Actually, being openSUSE 11.1 an out of cycle
version, you can not update it at all, because the repos were removed. You
may switch to evergreen, perhaps. The 11.1 repos that survive should have
been renamed to evergreen.

You can upgrade the entire distro, though - but you lack experience if you
hit problems during the procedure. And same thing for installing fresh,
because you do not know how the old machine is set up… This is one of the
circumstances where an upgrade is recommended over a fresh install.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)