LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-27-2004, 09:56 PM   #1
angel_hva
LQ Newbie
 
Registered: Mar 2004
Location: Vietnam
Posts: 24

Rep: Reputation: 15
MySQL on Linux


I'm still newbie, thus my question maybe stupid, hope everybody can help me with my problem. It's popular problem I think but this is the first time I install MySQL on Linux and I don't know how to fix this.

1. MySQL cannot connect through socket. What can I do?
2. R there anybody know how to make MySQL automatically turn on every time user login in Linux OS? So that we don't have to turn on it manually everytime we start our computer. I know how to automatically mount FAT partitions I want similar thing with MySQL.

Thanks in advanced.
 
Old 03-28-2004, 07:35 AM   #2
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
1) Is your mysqld server running? If you use the ps -A command, you should see mysqld in the list of running processes. If it isn't running, you can start it with the mysqld_safe & command

2) Just add mysqld_safe & to one of your startup scripts and mysql will run every time you boot up.
 
Old 03-28-2004, 08:41 AM   #3
tuxguy
Member
 
Registered: Mar 2004
Location: North Bay, Ontario - CANADA
Distribution: Debian
Posts: 77

Rep: Reputation: 16
as for the connecting to the socket.. are you trying to connect to the mysql server via mysqlcc ?? if so you will have to edit the my.cnf (check /etc/mysql/). look for skip-networking and place a comment in front of it. then restart your mysqld
 
Old 03-28-2004, 11:54 PM   #4
angel_hva
LQ Newbie
 
Registered: Mar 2004
Location: Vietnam
Posts: 24

Original Poster
Rep: Reputation: 15
Quote:
Is your mysqld server running?
I can not run it, it's my problem.

Quote:
Just add mysqld_safe & to one of your startup scripts and mysql will run every time you boot up.
Can u explain precisely about startup scripts? Can u told me the way to configure it?
 
Old 03-29-2004, 02:43 AM   #5
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
how did u install mysql as an rpm or did u compile it? if installed as an rpm u may start it
/etc/init.d/mysql start
u find different startup scripts in /etc/init.d depending on the runlevel you are working on.
init.d is responsible for starting programs while/after booting.
u may take a look at
man init.d
to get some more information.
on my distro theres a file
/sbin/init.d/README
which supplies further information
type
locate init.d
to check out if there's some more stuff if u dont find a solution

Last edited by j-ray; 03-29-2004 at 02:55 AM.
 
Old 03-29-2004, 05:15 AM   #6
tuxguy
Member
 
Registered: Mar 2004
Location: North Bay, Ontario - CANADA
Distribution: Debian
Posts: 77

Rep: Reputation: 16
have you setup the root user and password?

$/mysqladmin -u root password 'yourpassword'
 
Old 03-29-2004, 07:11 AM   #7
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Quote:
I can not run it, it's my problem.
I'm not sure that I understand your problem. Can you not run mysqld_safe or can you not run ps -A? If you can't run mysqld_safe, then nothing else matters because you will not be able to access mysql. Running mysqld is the first priority.
 
Old 04-01-2004, 11:42 PM   #8
angel_hva
LQ Newbie
 
Registered: Mar 2004
Location: Vietnam
Posts: 24

Original Poster
Rep: Reputation: 15
Thanks everybody but I'm sorry I still get problem. I tried version 4.0.17, 5.0.0 alpha, 3.23.52 max but nothing ...
The way I used:
- I installed 4.0.17
- With 5.0.0 I used directly in bin folder (because it's built already for using)

Yes, I tried to run both mysqld_safe, safe_mysqld, mysqld but sometimes it run, sometimes can not (I don't know the reason). But even after it run (I'm sure coz I typed ps -A and see in the list mysqld_safe and mysqld), I still can not connect and the error message I got is:
Cannot connect through socket(111) at /tmp/mysql.mysock
or something like that.

Before I found mysql.mysock but now I can not find it, really confused. I'm crazy already and don't know what I have to do.

Do I need to delete the old version before install a new one?
 
Old 04-02-2004, 10:33 AM   #9
tuxguy
Member
 
Registered: Mar 2004
Location: North Bay, Ontario - CANADA
Distribution: Debian
Posts: 77

Rep: Reputation: 16
I take it you have set up the users and hosts in order to have access to the server... give us a list of things you have done (set up) and things u have tried in order to connect...

Thanks
Jesse
 
Old 04-06-2004, 05:53 AM   #10
angel_hva
LQ Newbie
 
Registered: Mar 2004
Location: Vietnam
Posts: 24

Original Poster
Rep: Reputation: 15
Thanks everybody, at last it's fine. I found my problem. The problem is my.cnf has the line in that configuration to mysql.sock is not /tmp/mysql.sock

In order to make it run, I found 2 ways:

shell> mysql -u root -p --socket path_to_sockfile

or

Modify my.cnf

Now, I can run it quite well, also mysql.server I copied to etc/init.d and add to boottime list like this:

shell> chkconfig --add mysql.server

Now I don't get any problem anymore. Even run mysql 4.0.17 or 5.0.0 alpha, it's fine.

R there anybody can tell me more about /etc/init.d, example with mysql we have mysql.server, how about other programs, example httpd ... ?
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. NoviceW Linux - Networking 17 09-17-2014 02:13 PM
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock welery Linux - Software 19 03-06-2014 07:19 AM
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. suziecorbett Linux - Software 8 10-09-2008 01:52 AM
Problems with MySQL on SuSE: Can't Connect (/var/lib/mysql/mysql.sock) neocookie Linux - Software 8 02-07-2008 11:48 PM
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

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:01 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