LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-09-2004, 10:21 PM   #1
oRg
LQ Newbie
 
Registered: Mar 2004
Distribution: SuSE 9.0Pro-9.1-9.2, Knoppix 3.4-3.6-STD, Red Hat Linux 7.0, Solaris 9
Posts: 13

Rep: Reputation: 0
Exclamation MySQL Problem...Please Help


Ok, I know there are alot of posts and topics as it is right now so any help would be appreciated. Now I have checked around and searched for threads talking about similar problems but alas my searches have lead to no avail. Here's my problem. I use SuSE 9.0 Pro and I just installed mysql-max-4.0.18-pc-linux-i686.tar.gz . When I first installed it earlier today I had no problem running it and basically started to experiement and learn how to do this and that with MySQL databases, table, etc etc. Well I log off and restart so my brother could go on Windows, seeming how I have a dual boot, and when I came to return to where I was I typed
linux:~ # mysql
and I got this error message
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!
Any help will be greatly appreciated.

Last edited by oRg; 03-09-2004 at 10:29 PM.
 
Old 03-09-2004, 11:27 PM   #2
needforspeed
Member
 
Registered: Aug 2003
Distribution: Gentoo
Posts: 73

Rep: Reputation: 15
I had a similar problem and never found the answer either. I'm curious to know what it is.

But mine somehow fixed itself. I ran in XP for a couple weeks solid and when I booted up Linux, it was working and has worked ever since. I don't know if it just needed a restart to work or what, but it was rediculous. Hopefully somebody can tell us what the problem is.
 
Old 03-09-2004, 11:30 PM   #3
alcattle
LQ Newbie
 
Registered: Mar 2004
Location: Seattle,Wa
Distribution: Arch
Posts: 18

Rep: Reputation: 0
It sounds like the mysqld daemon is not starting. REad the mysql docs for adding the server to your start commands, I am not familiar with slack
 
Old 03-10-2004, 12:06 AM   #4
flamesrock
Member
 
Registered: Aug 2003
Distribution: Gentoo 2006.1
Posts: 405

Rep: Reputation: 30
This is a problem which needs to be adressed.

I had the same problem a few days ago, but thankfully, I had a friend who could come in a fix it.

I think its a file called 'my.cf' which you need to modify. THen you need to kill the extra mysql instances.

Sorry, I wish I could help more.
 
Old 03-10-2004, 12:26 PM   #5
mosdef
LQ Newbie
 
Registered: Mar 2004
Location: New Mexico, USA
Posts: 6

Rep: Reputation: 0
I had a similar problem, although I don't use the dual boot. This link helped me out, maybe it'll work for you, but I can't be sure. Hope it helps:
http://forums.devarticles.com/showthread.php?t=4635
 
Old 03-10-2004, 12:42 PM   #6
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
If you had it running before and rebooted and then cannot connect, that clearly tells us its just simply not running.

Type:

mysqld_safe &

That should start the daemon and then type:

mysql

To connect to it, etc.
 
Old 03-10-2004, 09:22 PM   #7
flamesrock
Member
 
Registered: Aug 2003
Distribution: Gentoo 2006.1
Posts: 405

Rep: Reputation: 30
wrong thread..

Last edited by flamesrock; 03-11-2004 at 12:06 AM.
 
Old 03-11-2004, 12:49 AM   #8
oRg
LQ Newbie
 
Registered: Mar 2004
Distribution: SuSE 9.0Pro-9.1-9.2, Knoppix 3.4-3.6-STD, Red Hat Linux 7.0, Solaris 9
Posts: 13

Original Poster
Rep: Reputation: 0
Well so far it still gives me the error message. I'm thinking of just reinstalling it anyways and starting from scratch. The bad thing is I already got the databases going for my new website. I tried typing:

mysqld_safe &
mysql

and this is what I got:

linux:~ # Starting mysqld daemon with databases from /var/lib/mysql
040311 01:38:33 mysqld ended
linux:~ # mysql
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

I'm gonna reinstall tomorrow sometime cuz I'm too tired to do it now. Thanx for your help though guys and if anyone else can help out please post. Even though I'm reinstalling doesn't mean it's gonna fix the problem. Thanx
 
Old 03-11-2004, 05:31 AM   #9
MunterMan
Member
 
Registered: Nov 2003
Location: The North of England
Distribution: Suse 10.3
Posts: 172

Rep: Reputation: 30
It looks like your file permissions got mixed up.
Before reinstalling try changing the ownership of the data back to the user with the following commands;


chown -R root:mysql /usr/local/mysql
chown -R mysql:mysql /usr/local/mysql/data

(These are out of the tutorial, so they should work)
 
Old 03-29-2004, 03:34 PM   #10
llathrop
LQ Newbie
 
Registered: Mar 2004
Location: Modesto, CA
Distribution: slackware
Posts: 2

Rep: Reputation: 0
If the file '/var/lib/mysql/mysql.sock' does not exist, check where it should be in the my.conf. this will be pehaps /tmp/mysql.sock or similar. make a link between where it is and where it should be.
Ex:
ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock


of course that's really the cheating way. somewhere a config fileis pointing at the wrong socket. Perhaps one component was upgraded and changed something?
 
Old 03-29-2004, 03:41 PM   #11
jsokko
Member
 
Registered: Mar 2004
Location: Phila, PA
Distribution: SuSE 9.0 / RH 9 / Slackware 9.1
Posts: 110

Rep: Reputation: 15
I had the same issue as well when I first installed SuSE. It's because you already have an instance of the DB running as a daemon... most likely because you installed it during initial setup and have installed the MAX version on top, therefore the .sock error.

so:

1. BACKUP YOUR DB. Tarball it, copy the dir somewhere else, burn it whatever -- just BACKUP your db first.

2. check YAST for MySQL. if it is checked, remove it. afterwards, reboot.

3. remove your MySQL-MAX (why are you using MAX anyway?? you should be using standard).

4. DL/Install MySQL-standard via the hard way (or you could try the RPM but I can't guarantee that'll work for ya) and relink the server file by mv -ing and renaming it to either rc.mysql or rc.mysqld in /etc/rc.d

I hope that helps.
 
Old 05-30-2004, 05:06 AM   #12
SuSE_fan
LQ Newbie
 
Registered: Apr 2004
Location: Provo, Utah, USA
Distribution: SuSE 9.0 Professional
Posts: 19

Rep: Reputation: 0
HI there all,

I am using SuSE 9.1 and installed php, mysql and apache2 using YAST during installation. Once done, I couldn't start MySQL as zillions of others... so far all I know is it is some permission error. Now, to issue the following command...

chown -R root:mysql /usr/local/mysql
chown -R mysql:mysql /usr/local/mysql/data

I need to have a directory named mysql inside /usr/local.. right? Amazingly, YAST doesn't create this folder... BUMMER!!!

I tried to edit the runlevel editor (inside YAST) and tried to turn on mysql daemon during startup. But, it fails for some "Unexpected error" .. BUMMER AGAIN!!!!

I just can't start my MySQL daemon running.. i have a user mysql, group mysql.. and it was working with SuSE 9.0 .. I know it will work if I remove MySQL using YAST and install a fresh copy from Taball wiht --prefix = /usr/local/mysql option...

but, HOW CAN I USE YAST to fix this??? where in the world is my MySQL folder? there is no folder named scripts... to issue the following command...

$ scripts/mysql_install_db

now, this file is in /var/lib .. wierd .. huh??

Any help??????????????

All I want is to start mysql daemon from user mysql ...

--------------
this is what is happenning now...
(as root)
$ mysql_install_db --user=mysql

indium:/usr/bin # mysql_install_db --user=mysql
Installing all prepared tables
040530 3:54:02 /usr/sbin/mysqld: Shutdown Complete


PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h indium.galaxy password 'new-password'
See the manual for more instructions.

NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run
the /usr/bin/mysql_fix_privilege_tables. Otherwise you will not be
able to use the new GRANT command!


You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; perl run-all-tests

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at https://order.mysql.com

### SO, to start the server, as mysql, i typed ..

$exit
$mysqld_safe --user=mysql &

it spits out the following...

[1] 11052
indium:/usr/bin # Starting mysqld daemon with databases from /var/lib/mysql
040530 03:56:12 mysqld ended
$

thats all about it... now, if I assume that this /var/lib/mysql is /usr/local/mysql directory, then I have another problem. /var/lib is not user accessible. Is it?? and there is no /data/ folder inside this /var/lib/mysql folder.

ANY HELP????????????

I am THIIIIIIIIIIIIIIIIS close to give up on YAST ...
 
Old 08-05-2004, 12:19 PM   #13
candyshot
LQ Newbie
 
Registered: Aug 2004
Distribution: Suse
Posts: 1

Rep: Reputation: 0
Thumbs up suse mysql problem

I got this working !

After a few hours a got an solution...
I uninstalled mysql and mysql-max with yast
and installed the mysql package only!

and when I started the service it ran without any problems!
 
Old 11-16-2004, 06:51 PM   #14
uslic001
LQ Newbie
 
Registered: Mar 2004
Posts: 6

Rep: Reputation: 0
found the answer

These fixes listed above did not work for me. I then found this site and now MySQL works perfectly in SUSE 9.0 via YAST.

http://www.topology.org/linux/mysql.html

Good luck. I hope it works for you.
 
Old 11-17-2004, 08:40 AM   #15
hunterfighter
Member
 
Registered: Oct 2004
Location: Malaysia, Kuala Lumpur
Distribution: FreeBSD
Posts: 65

Rep: Reputation: 15
I face the problem too. I just installed my slackware, then i make it start the deamon during startup. After few seconds of the mysqld is started, it will automatically ended.

Any solution?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bugzilla - MySQL - perl - DBD::mysql install problem Runningonair Linux - Software 8 10-12-2007 12:42 AM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 08:44 AM
mysql 4.0.24 to mysql 4.1.12 upgrade problem tuxrules Slackware 7 08-13-2005 06:43 PM
MySQL server problem after linking (mysql.sock) ewijaya Linux - General 4 01-19-2004 09:46 AM
MySQL mysql-3.23.56-1.9, rpm install problem jacsmith510 Linux - Newbie 3 09-19-2003 02:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration