MySQL cannot connect - Mandriva

This is a discussion on MySQL cannot connect - Mandriva ; Whenever I try to interact with MySQL I get this error message: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13). I could not find such a file and so created one with the user mysql ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: MySQL cannot connect

  1. MySQL cannot connect

    Whenever I try to interact with MySQL I get this error message:
    ERROR 2002 (HY000): Can't connect to local MySQL server through
    socket '/var/lib/mysql/mysql.sock' (13).

    I could not find such a file and so created one with the user mysql and
    group mysql. I also created also /var/lib/mysql/mysqlmanager.sock (regerred
    to in my.cnf)

    I still got the same error.

    I have tried:

    1) $ mysql -h localhost -u mythtv -pmythtv
    2) $ mysqladmin -u root password
    3) $ mysql -u root -p < mc.sql
    4) $ mysql -h localhost -u root -p

    Result same error message.

    If I cannot get further, how can I wipe out the mysql database and start
    again from scratch?



  2. Re: MySQL cannot connect

    Alan Secker wrote:

    > Whenever I try to interact with MySQL I get this error message:
    > ERROR 2002 (HY000): Can't connect to local MySQL server through
    > socket '/var/lib/mysql/mysql.sock' (13).
    >
    > I could not find such a file and so created one with the user mysql and
    > group mysql. I also created also /var/lib/mysql/mysqlmanager.sock
    > (regerred to in my.cnf)
    >
    > I still got the same error.
    >
    > I have tried:
    >
    > 1) $ mysql -h localhost -u mythtv -pmythtv
    > 2) $ mysqladmin -u root password
    > 3) $ mysql -u root -p < mc.sql
    > 4) $ mysql -h localhost -u root -p
    >
    > Result same error message.
    >
    > If I cannot get further, how can I wipe out the mysql database and start
    > again from scratch?


    It isn't your database that you have to wipe. This one gave me no end of
    trouble. I was running mysqld-safe (which worked) but it had the distinct
    feel of a workaround.

    One fix that worked for a while was to delete the ibdata and ib-logfile
    files. These are re-created. But that was only temporary.

    I found the real fix in an overseas newsgroup. Delete the current files
    in /var/log/mysqld (at the moment I have only mysqlmanager.log.) If you
    want to keep it, back it up. In some unexplained way, if the logfile is
    defective in format, it causes the problem. Rotated and gzipped files
    should not be a problem, but do you need them, anyway?

    Occasionally, I have backed up my databases and started with a clean /var
    directory. On those occasions, I have never had a problem.

    HTH,

    Doug.

  3. Re: MySQL cannot connect

    Doug Laidlaw wrote:

    > Alan Secker wrote:
    >
    >> Whenever I try to interact with MySQL I get this error message:
    >> ERROR 2002 (HY000): Can't connect to local MySQL server through
    >> socket '/var/lib/mysql/mysql.sock' (13).
    >>
    >> I could not find such a file and so created one with the user mysql and
    >> group mysql. I also created also /var/lib/mysql/mysqlmanager.sock
    >> (regerred to in my.cnf)
    >>
    >> I still got the same error.
    >>
    >> I have tried:
    >>
    >> 1) $ mysql -h localhost -u mythtv -pmythtv
    >> 2) $ mysqladmin -u root password
    >> 3) $ mysql -u root -p < mc.sql
    >> 4) $ mysql -h localhost -u root -p
    >>
    >> Result same error message.
    >>
    >> If I cannot get further, how can I wipe out the mysql database and start
    >> again from scratch?

    >
    > It isn't your database that you have to wipe. This one gave me no end of
    > trouble. I was running mysqld-safe (which worked) but it had the distinct
    > feel of a workaround.
    >
    > One fix that worked for a while was to delete the ibdata and ib-logfile
    > files. These are re-created. But that was only temporary.
    >
    > I found the real fix in an overseas newsgroup. Delete the current files
    > in /var/log/mysqld (at the moment I have only mysqlmanager.log.) If you
    > want to keep it, back it up. In some unexplained way, if the logfile is
    > defective in format, it causes the problem. Rotated and gzipped files
    > should not be a problem, but do you need them, anyway?
    >
    > Occasionally, I have backed up my databases and started with a clean /var
    > directory. On those occasions, I have never had a problem.
    >
    > HTH,
    >
    > Doug.


    I followed what you did but no go. When I tried to execute mysql though, It
    returned a (new) message reporting an error at line 161. I decided this
    indicated some kind of corruption. I uninstalled mysql and dependencies,
    rebooted and reinstalled. I had to start it by hand but it came up. Now
    back to mythtv!!!

    Thanks for your help.

    Regards

    Alan

+ Reply to Thread