TechTalkz.com Logo Ask the Expert

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Tech Support Archives > Linux & Opensource > Mandriva Linux

Notices

MySQL cannot connect

Mandriva Linux


Reply
 
Thread Tools Display Modes
Old 06-11-2007, 05:30 AM   #1
Alan Secker
Guest
 
Posts: n/a
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 <my-root-password>
3) $ mysql -u root -p < mc.sql
4) $ mysql -h localhost -u root -p<my-root-password>

Result same error message.

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


  Reply With Quote
Old 08-11-2007, 09:30 AM   #2
Doug Laidlaw
Guest
 
Posts: n/a
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 <my-root-password>
> 3) $ mysql -u root -p < mc.sql
> 4) $ mysql -h localhost -u root -p<my-root-password>
>
> 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.
  Reply With Quote
Old 17-11-2007, 04:32 AM   #3
Alan Secker
Guest
 
Posts: n/a
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 <my-root-password>
>> 3) $ mysql -u root -p < mc.sql
>> 4) $ mysql -h localhost -u root -p<my-root-password>
>>
>> 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 With Quote
Reply

Thread Tools
Display Modes



< Home - Windows Help - MS Office Help - Hardware Support >


New To Site? Need Help?

All times are GMT +5.5. The time now is 06:18 PM.


vBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO
Copyright © 2005-2010, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional