Announcement

Collapse
No announcement yet.

Mysqld.sock trouble

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Mysqld.sock trouble

    I worked with Mysql last night, exited from it and powered down, but when I powered up this morning I got this:

    john@john-N105:~$ mysql
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
    john@john-N105:~$

    Following Google tracks to Ubuntu forums, etc., I tried many things, including "complete removal" of Mysql-client and Mysql-server and "reinstall" of Mysql-common (complete removal of it would have taken out all sorts of kde packages that I didn't want to risk). No deal. Here are a few other things I tried:

    [By the way, everything in /var/lib/mysql has been chown/chgrp'd to "mysql" and I (john) am a member of the mysql group.]

    john@john-N105:~$ sudo service mysql start
    start: Job failed to start
    john@john-N105:~$

    john@john-N105:~$ mysqld
    140127 20:42:26 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
    140127 20:42:26 [Warning] Can't create test file /var/lib/mysql/john-N105.lower-test
    140127 20:42:26 [Warning] Can't create test file /var/lib/mysql/john-N105.lower-test
    mysqld: Can't change dir to '/var/lib/mysql/' (Errcode: 13)
    140127 20:42:26 [ERROR] Aborting
    140127 20:42:26 [Note] mysqld: Shutdown complete
    john@john-N105:~$

    john@john-N105:~$ sudo mysqld_safe
    140127 20:48:32 mysqld_safe Can't log to error log and syslog at the same time. Remove all --log-error configuration options for --syslog to take effect.
    140127 20:48:32 mysqld_safe Logging to '/var/log/mysql/error.log'.
    140127 20:48:32 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    140127 20:48:32 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
    john@john-N105:~$

    john@john-N105:~$ sudo mysql_upgrade
    [sudo] password for john:
    Looking for 'mysql' as: mysql
    Looking for 'mysqlcheck' as: mysqlcheck
    FATAL ERROR: Upgrade failed
    john@john-N105:~$

    I have some output from /var/log/mysql/error.log, as recommended when I ran "mysqld_safe", and can reproduce some of that if it might be helpful. I'll be happy to provide any other output that forum participants might like to see.

    Sure was a surprise to exit a fully functioning Mysql last night, then find that I couldn't start it this morning.
    -- Werdigo49
    Registered Linux User #291592
    Kubuntu Xenial Xerus (16.04)

    #2
    Thanks to those who have looked at this thread. I'm still working on it.

    (1) I have a Mint 13 installation that runs Mysql, so I tried copying the /run/mysqld files (mysqld.pid and mysqld.sock), and a /usr/sbin/mysqld directory, from Mint to this K Raring. No deal.

    (2) This morning I ran "ps -A" and saw no mysqld or mysql on the list. Trying "sudo service mysql start" again gave a "Job failed to start"

    (3) After complete-removing and reinstalling as described above, I simply tried "mysqld". Following directions, I asked for an install of mysql-server-core-5.5, and was told (as expected) that it's already installed. But trying "mysqld" again, again asked for it to be installed.

    john@john-N105:/$ mysqld
    The program 'mysqld' is currently not installed. You can install it by typing:
    sudo apt-get install mysql-server-core-5.5
    john@john-N105:/$ sudo apt-get install mysql-server-core-5.5
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    mysql-server-core-5.5 is already the newest version.
    The following packages were automatically installed and are no longer required:
    libhamlib-utils libssl-dev libssl-doc zlib1g-dev
    Use 'apt-get autoremove' to remove them.
    0 upgraded, 0 newly installed, 0 to remove and 409 not upgraded.
    john@john-N105:/$ mysqld
    The program 'mysqld' is currently not installed. You can install it by typing:
    sudo apt-get install mysql-server-core-5.5
    john@john-N105:/$

    I did not bother removing the unneeded packages because I don't think they're causing the problem.

    Seems to me I used to have a "sock" problem with WordPerfect, and the solution was to delete its sock file before starting WP; the program would then generate its own. Don't know if that's relevant here or not.
    -- Werdigo49
    Registered Linux User #291592
    Kubuntu Xenial Xerus (16.04)

    Comment


      #3
      Just out of curiosity, what happens if you
      Code:
      sudo apt-get reinstall mysql-server-core-5.5
      I do not personally use Kubuntu, but I'm the tech support for my daughter who does.

      Comment


        #4
        john@john-N105:~$ sudo apt-get reinstall mysql-server-core-5.5
        [sudo] password for john:
        E: Invalid operation reinstall
        john@john-N105:~$
        -- Werdigo49
        Registered Linux User #291592
        Kubuntu Xenial Xerus (16.04)

        Comment


          #5
          The command should be:

          sudo apt-get --reinstall install <package>

          Please Read Me

          Comment


            #6
            Thanks, Buddlespit and oshunluvr. Here's the output... a little better but same error message.

            john@john-N105:~$ sudo apt-get --reinstall install mysql-server-core-5.5
            [sudo] password for john:
            Reading package lists... Done
            Building dependency tree
            Reading state information... Done
            The following packages were automatically installed and are no longer required:
            libhamlib-utils libssl-dev libssl-doc zlib1g-dev
            Use 'apt-get autoremove' to remove them.
            0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 409 not upgraded.
            Need to get 0 B/5,677 kB of archives.
            After this operation, 0 B of additional disk space will be used.
            (Reading database ... 157171 files and directories currently installed.)
            Preparing to replace mysql-server-core-5.5 5.5.34-0ubuntu0.13.04.1 (using .../mysql-server-core-5.5_5.5.34-0ubuntu0.13.04.1_i386.deb) ...
            Unpacking replacement mysql-server-core-5.5 ...
            Processing triggers for man-db ...
            Setting up mysql-server-core-5.5 (5.5.34-0ubuntu0.13.04.1) ...
            john@john-N105:~$ mysql
            ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
            john@john-N105:~$
            -- Werdigo49
            Registered Linux User #291592
            Kubuntu Xenial Xerus (16.04)

            Comment


              #7
              Originally posted by oshunluvr View Post
              The command should be:

              sudo apt-get --reinstall install <package>
              sorry, I forget that apt-get cli is different from aptitude... I should change it to:
              Code:
              $ sudo apt-get install aptitude
              $ sudo aptitude reinstall mysql-server-core-5.5
              I do not personally use Kubuntu, but I'm the tech support for my daughter who does.

              Comment


                #8
                Well, guys, I finally gave up and reinstalled Raring. Since I saved the /home partition and, over time, have learned to save the .deb's of various programs that I use in /home, it only took about 1.5 hours to restore the setup. Mysql now works, and (of course) ps -A shows "mysqld" running.

                In the old days, having to reinstall an OS was considered an admission of defeat... maybe it still is. I'm not that proud!
                -- Werdigo49
                Registered Linux User #291592
                Kubuntu Xenial Xerus (16.04)

                Comment

                Working...
                X