LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-02-2007, 08:07 PM   #1
trebek
Member
 
Registered: Feb 2005
Location: Costa Rica
Distribution: Ubuntu, gOS, Debian & Slack 12
Posts: 426

Rep: Reputation: 30
Mysql socket error and can't get it to start


Hello.

I am trying to get cacti working, but unfortunately, i need to install mysql. Here's the problem: i was getting a black page when loading the cacti web interface on a browser. So i installed a php-mysql package that was missing. Once that was installed, i tried connecting to mysql and i got the following error:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111)
So i researched and found that i could tell my.conf to find the socket file in /var/lib/mysql/mysql.sock. So i went ahead and changed that in my.conf, and i got the following error:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
As you can see, that didn't work. So started to research again and read that this happens when mysql is not running, and indeed, it wasn't running. So tried to start mysql and got the following lines:
[1] 22862
[root@penguin2 etc]# Starting mysqld daemon with databases from /var/lib/mysql
STOPPING server from pid file /var/run/mysqld/mysqld.pid
070402 19:22:41 mysqld ended


[1]+ Done /usr/local/mysql/bin/mysqld_safe --user=root

As you can see, the server won't start. What's the problem here?

Thanks in advance for the help.
 
Old 04-02-2007, 09:15 PM   #2
kstan
Member
 
Registered: Sep 2004
Location: Malaysia, Johor
Distribution: Dual boot MacOS X/Ubuntu 9.10
Posts: 851

Rep: Reputation: 31
you recompile your mysql server from source? have u remove your old mysql server/client/common?
I facing this kind of issue before, try to completely uninstall your original mysql package.

Regards,
Ks
 
Old 04-02-2007, 11:25 PM   #3
trebek
Member
 
Registered: Feb 2005
Location: Costa Rica
Distribution: Ubuntu, gOS, Debian & Slack 12
Posts: 426

Original Poster
Rep: Reputation: 30
Ok, so now, i managed to get everything working with mysql, including creating the database and running the sql script that comes with cacti to create the mysql cacti database. Now, i set the permissions for the cacti user and the password, with host and stuff, and checked the mysql.user table to make sure i had it right. So, i gave all privileges to the cacti user on cacti.* as the cacti manual said i should. Nevertheless, i keep getting this error when loading the cacti web interface on the browser:
Code:
Error

You have created a new database, but have not yet imported the 'cacti.sql' file. At the command line, execute the following to continue:

mysql -u cacti -p cacti < cacti.sql

This error may also be generated if the cacti database user does not have correct permissions on the cacti database. Please ensure that the cacti database user has the ability to SELECT, INSERT, DELETE, UPDATE, CREATE, ALTER, DROP, INDEX on the cacti database.
Also, after verifying that i had the right permissions, i checked to see if the sql script actually created something inside the cacti database, and yep, it did. I can see a bunch of tables there.

So, i am not really sure what the problem could be here. I followed the instructions to the letter, no questions asked.

Help dude please!!! And thanks in advance for the wise advice.

Last edited by trebek; 04-03-2007 at 05:37 PM.
 
Old 04-04-2007, 01:25 AM   #4
kstan
Member
 
Registered: Sep 2004
Location: Malaysia, Johor
Distribution: Dual boot MacOS X/Ubuntu 9.10
Posts: 851

Rep: Reputation: 31
how you create user cacti and how you give him permission? have you manual create a table inside cacti database (before import) for testing purposes?
 
Old 04-05-2007, 12:14 PM   #5
trebek
Member
 
Registered: Feb 2005
Location: Costa Rica
Distribution: Ubuntu, gOS, Debian & Slack 12
Posts: 426

Original Poster
Rep: Reputation: 30
Here's how i created the user from withing mysql: (i followed the instructions from the cacti manual itself)

1. grant all privileges on cacti.* to 'cacti'@'localhost' identified by 'password';
I also attemped to grant privileges using cacti@localhost, without the '.

2. flush privileges;

I double checked that this user existed in mysql.user.

1. select Host, User from mysql.user where user = 'cacti';

Here's the output of the command:
+-----------+-------+
| Host | User |
+-----------+-------+
| % | cacti |
| localhost | cacti |
+-----------+-------+

Also, i have the system cacti user, dubbed cacti:x:100:101:cacti:/var/www/cacti:/bin/sh, this is the entire entry in /etc/passwd for him, that i need to have to run the cron job and to assign permissions on rra/ and log/ directories for graphing and logging. I don't know if the problem could be related. I am just giving you as much info as i can and remember to help you help me. JEJEJE.

Thanks for the aid.

Last edited by trebek; 04-05-2007 at 12:22 PM.
 
Old 04-05-2007, 03:46 PM   #6
mcupples
Member
 
Registered: Jun 2006
Location: Orlando
Distribution: FC3, FC5, CentOS4, Ubuntu 6.06
Posts: 57

Rep: Reputation: 15
Quote:
Originally Posted by trebek
Ok, so now, i managed to get everything working with mysql, including creating the database and running the sql script that comes with cacti to create the mysql cacti database.
Wait, how'd you fix that? I'm getting the same error after installing, then re-installing.
 
Old 04-05-2007, 04:11 PM   #7
trebek
Member
 
Registered: Feb 2005
Location: Costa Rica
Distribution: Ubuntu, gOS, Debian & Slack 12
Posts: 426

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by mcupples
Wait, how'd you fix that? I'm getting the same error after installing, then re-installing.
As i remember fixing it, i deleted the other version i had installed, i had to install some php-mysql package, which then gave me the mysql socket error, but then i edited my.conf to set socket to the other location.

It was really a strange arrange of steps, but i can't tell you for sure which one did the trick. Just know this, the instructions from the mysql documentation or site are not correct, or at least complete.
 
Old 04-05-2007, 07:15 PM   #8
kstan
Member
 
Registered: Sep 2004
Location: Malaysia, Johor
Distribution: Dual boot MacOS X/Ubuntu 9.10
Posts: 851

Rep: Reputation: 31
if I'm not mistaken after you install mysql using rpm, the binary inside /usr/bin(mysql, mysql_safe and etc) by default socket is point to some place (maybe here /var/lib/mysql/mysql.sock). The if you install another mysql-server with prefix=/usr/local, the probably you the binary inside /usr/local/bin(mysql,mysql_safe) will point socket to another place (probably /tmp/mysqk.sock).

So during you start mysql-client or mysql-server, you may mis-choose the binary and they can't find the target socket.

Anyway, if you use mysql client with option socket, then mysql client can find the proper location of socket. Everything will be ok.

Regards,
Ks
 
Old 04-06-2007, 04:16 PM   #9
mcupples
Member
 
Registered: Jun 2006
Location: Orlando
Distribution: FC3, FC5, CentOS4, Ubuntu 6.06
Posts: 57

Rep: Reputation: 15
Quote:
Originally Posted by kstan
Everything will be ok.
EVERYTHING IS NOT OKAY FAST ENOUGH! MAKE IT OKAY FASTER!

ps: That's a joke in reference to: http://video.google.com/videoplay?do...74113486697064. Don't take me seriously.

Last edited by mcupples; 04-06-2007 at 04:18 PM.
 
Old 04-07-2007, 04:09 AM   #10
trebek
Member
 
Registered: Feb 2005
Location: Costa Rica
Distribution: Ubuntu, gOS, Debian & Slack 12
Posts: 426

Original Poster
Rep: Reputation: 30
I see what you mean, specially the faster part. ROTGL, LOL.

A little humor helps out.
 
  


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
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
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
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.so amee_stars Linux - Newbie 2 01-22-2007 02:48 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 socket error 3p0ch Linux - Networking 4 01-14-2005 07:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:43 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
Open Source Consulting | Domain Registration