LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-17-2003, 01:47 PM   #1
jivago
LQ Newbie
 
Registered: Dec 2003
Posts: 5

Rep: Reputation: 0
Can't get MySQL to work at all.


I've been struggling for a couple of weeks, trying to get mysql to work with no success. I've reinstalled Redhat, Redhat AS, and Suse 9 a couple of dozen times on two differnt computers. Mysql always gives some variant of this error message:

mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!

No the socket doesn't exist.

The only time that I got it to work was when I installed cPanel on the computer. Everything worked fine, but cPanel limited my options so I wanted a box without it.

I just finished a Redhat AS install with NO Apache, mysql, PHP, etc installed during the install. I then exactly followed the instructions on dududu.brtnet.org/linux/lamp.htm and got the same error yet again.

I'm a Linux newbie, but am getting the hang of some stuff, I'm an old time Norton Commander/Windows Commander user, so I can relate to Midnight Commander (I'd be lost without it). I've got Apache working, I've used SSH/Putty, installed binaries, RPMs, updates, etc., but I just can't get mysql to work.

Can somebody help me?

Thanks,

JivaGo
 
Old 12-17-2003, 02:01 PM   #2
jivago
LQ Newbie
 
Registered: Dec 2003
Posts: 5

Original Poster
Rep: Reputation: 0
The "dududu" up there should be "www". The system wouldn't let me upload a URL.
 
Old 12-17-2003, 04:08 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Check the ownership/permissions on both the
directory and the special file.

Or just use http://www.postgresql.org ;)



Cheers,
Tink
 
Old 12-17-2003, 09:24 PM   #4
jivago
LQ Newbie
 
Registered: Dec 2003
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Or just use http://www.postgresql.org
I did get postresql to work on one of the server incarnations.

I just don't get it though. Obviously it *could* work, I can't figure out what I'm doing wrong. I've followed several version of instructions.
 
Old 12-17-2003, 09:45 PM   #5
wdingus
Member
 
Registered: Aug 2001
Location: Kingsport, TN
Distribution: RHEL & FC
Posts: 267

Rep: Reputation: 30
A suggestion... One that is valid for LOTS of other posters on this forum with very similar questions and problems.

Don't follow one of those guides... Install the provided PHP, Apache, and MySQL that comes with the distribution. You mention both RedHat and RedHat AS, both of which I've also installed. Both come with these packages configured to work correctly together. Very painless, point-n-shoot during the install. Boot after the install is finished and it's functional right away...

Then, once you become very familiar with all these packages and how they interact and so forth, then by all means do something different. Just be sure at that point you're confident in your understanding of how they work and can put it back how it was.

You of course may need some feature that's not enabled or compiled-in by RH or other vendors but you didn't mention such in your message. So I'm assuming the vendor-provided packages will do what you need.

On RedHat, after doing an OS install making sure you selected these packages (or preferably in my opinion _everything_ so you don't have to worry about missing anything at all), do this:

[This can also be done graphically of course]

# chkconfig mysqld --list
^^ Check to see that it's "on" for the run level you're in at least (3 for non-graphical boot, 5 for graphical boot)

# chkconfig mysqld on
^^ To enable it for next boot if it wasn't set to start already

# mysqladmin password your-new-password
^^ To set the root password to one of your choice

# service mysqld restart
^^ To shutdown and restart the MySQL server. start/stop/status and other commands can be issued instead of restart.

Now you can run the text client with "mysql -p" and enter this password or "mysql -uroot -p" if you're not logged in as root or SU'ed, to force connecting to the MySQL server with that username. A PHP program dropped into /var/www/html at this point that accesses a MySQL database will be able to do so straight away in a stock RedHat install. I personally like phpMyAdmin for database administration.

Good Luck!

PS. A common thing from these guides is to start the server by typing "mysqld #" or something similar.. On RedHat, do not do this.. use "service" and let the startup/shutdown scripts take care of it for you... Life with MySQL will be MUCH easier if you do.
 
Old 12-22-2003, 09:45 AM   #6
jivago
LQ Newbie
 
Registered: Dec 2003
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by wdingus
# chkconfig mysqld --list
^^ Check to see that it's "on" for the run level you're in at least (3 for non-graphical boot, 5 for graphical boot)

# chkconfig mysqld on
^^ To enable it for next boot if it wasn't set to start already

# mysqladmin password your-new-password
^^ To set the root password to one of your choice

# service mysqld restart
^^ To shutdown and restart the MySQL server. start/stop/status and other commands can be issued instead of restart.
I've tried installing MySQL with the OS install several times. It's when I get to changing the password that I get the error mentioned above. Following the guides, installing it with the OS, doesn't seem to matter.
 
Old 12-22-2003, 01:59 PM   #7
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Quote:
Originally posted by jivago
I did get postresql to work on one of the server incarnations.

I just don't get it though. Obviously it *could* work, I can't
figure out what I'm doing wrong. I've followed several
version of instructions.
Which bit exactly do you fail to understand?



Cheers,
Tink
 
Old 12-22-2003, 03:22 PM   #8
jivago
LQ Newbie
 
Registered: Dec 2003
Posts: 5

Original Poster
Rep: Reputation: 0
I don't particularly understand any of it, however I can follow instructions. I just can't get it to work.

I just reinstalled MySQL from within the GUI with the same result.
 
Old 12-22-2003, 10:28 PM   #9
wdingus
Member
 
Registered: Aug 2001
Location: Kingsport, TN
Distribution: RHEL & FC
Posts: 267

Rep: Reputation: 30
Quote:
Originally posted by jivago
I don't particularly understand any of it, however I can follow instructions. I just can't get it to work.

I just reinstalled MySQL from within the GUI with the same result.
What exactly is "the same result"... I posted an almost step-by-step to starting a stock RedHat install of MySQL, setting it to auto-start on the next boot and assigning the root password. Did something in that fail or something else? We need _lots_ of details to be able to help...
 
Old 01-08-2004, 08:43 AM   #10
himanshu79
LQ Newbie
 
Registered: Nov 2003
Location: New Delhi, India
Distribution: redhat
Posts: 9

Rep: Reputation: 0
follow the instructions.
http://www.mysql.com/doc/en/Unix_post-installation.html
 
Old 01-08-2004, 10:37 AM   #11
cheesy1979
LQ Newbie
 
Registered: Oct 2003
Location: Aberdeen, Scotland
Distribution: Fedora
Posts: 6

Rep: Reputation: 0
I had a similar problem with RH9 and Fedora. When I tried to start up the server from the command line I got the old /tmp/mysql.sock message. I realised eventually that RedHat/Fedora set the server to run when the machine is booted.

Change this using the system settings -> server settings -> services menu. Scroll down to mysql and untick the box then click the stop button. Click the save button and close the services window.

If you open a terminal and start the server using mysqld_safe &(or any incarnation of mysqld) you should be rid of the /tmp/mysql.sock message and can then run the client using mysql -uUSER -pPASSWORD

Worked for me anyway!!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 09:44 AM
Getting MySQL to work right.... Zai Linux - Software 5 07-02-2005 01:06 PM
Can't get mySQL to work John_Emad Programming 6 04-17-2005 10:34 AM
mysql does not work karthic Linux - Enterprise 4 04-08-2005 06:21 PM
mysql wouldn't work :s JanDeMan Linux - Newbie 2 04-19-2004 06:54 AM


All times are GMT -5. The time now is 02:06 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration