LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 06-02-2010, 05:31 AM   #1
sawgata
LQ Newbie
 
Registered: May 2010
Posts: 15

Rep: Reputation: 0
Smile Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)


1.first question

i am using liferay5.2(mysql included in the download pack) on fedora.
while liferay is working fine but i cannot connect to mysql.i am getting the error
===============
[
[root@localhost ~]# ln -s /var/lib/mysql/mysql.sock /tmp
[root@localhost ~]# /etc/init.d/mysqld start
Timeout error occurred trying to start MySQL Daemon.
Starting MySQL: [FAILED]
[root@localhost ~]# service mysqld restart
Stopping MySQL: [FAILED]
Timeout error occurred trying to start MySQL Daemon.
Starting MySQL: [FAILED]
[root@localhost ~]# ln -s /var/lib/mysql/mysql.sock /tmp
ln: creating symbolic link `/tmp/mysql.sock': File exists
[root@localhost ~]# service mysqld restart
Stopping MySQL: [FAILED]
^Z
[1]+ Stopped service mysqld restart
[root@localhost ~]# /etc/init.d/mysqld start
Timeout error occurred trying to start MySQL Daemon.
Starting MySQL: [FAILED]
[root@localhost ~]# /etc/init.d/mysqld start
Timeout error occurred trying to start MySQL Daemon.
Starting MySQL: [FAILED]
[root@localhost ~]# mysql -u root
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[root@localhost ~]#

================================ ]

i didnt find the mysql.sock file in the location /var/lib/mysql/mysql.sock


2.second question.

i cannot find the portal-ext.properties file also to make intial settings.
 
Old 06-02-2010, 05:35 AM   #2
jamescondron
Member
 
Registered: Jul 2007
Location: Scunthorpe, UK
Distribution: Ubuntu 8.10; Gentoo; Debian Lenny
Posts: 961

Rep: Reputation: 69
Most useful tool, or at least directory, on your machine when trying to solve a problem:
Code:
/var/log/
Take a look at

Now, the mysql logs them self may or may not help (I haven't got any erroring databases to test) if not then 'messages'.

Find the error message/problem and if you can't solve it, post it back here.
 
Old 06-02-2010, 05:55 AM   #3
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,516

Rep: Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501
First you should make sure that mysqld is running:
Code:
ps -ef|grep mysqld
Then you should check my.cnf to see where the client (mysql) expects to find mysql.sock and where the server creates it. Make sure that both are the same.

Regards
 
Old 06-02-2010, 06:03 AM   #4
sawgata
LQ Newbie
 
Registered: May 2010
Posts: 15

Original Poster
Rep: Reputation: 0
Smile which file to look at

there are so many files in the /var/log/
which one i look to find the error of mysql posted above.

kindly ans the second question also .
 
Old 06-02-2010, 06:13 AM   #5
sawgata
LQ Newbie
 
Registered: May 2010
Posts: 15

Original Poster
Rep: Reputation: 0
[mysqladmin]
user=root

[mysqld]
basedir=/opt/liferay-5.2.3-1/mysql
datadir=/opt/liferay-5.2.3-1/mysql/data
port=3306
socket=/opt/liferay-5.2.3-1/mysql/tmp/mysql.sock
tmpdir=/opt/liferay-5.2.3-1/mysql/tmp

[mysqld_safe]
mysqld=mysqld.bin

[client]
port=3306
socket=/opt/liferay-5.2.3-1/mysql/tmp/mysql.sock

[manager]
port=3306
socket=/opt/liferay-5.2.3-1/mysql/tmp/mysql.sock
pid-file=/opt/liferay-5.2.3-1/mysql/tmp/manager.pid
default-mysqld-path=/opt/liferay-5.2.3-1/mysql/bin/mysqld.bin



i found this in my.cnf file.Everything seems to me correct
what is the error
 
Old 06-02-2010, 06:17 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,516

Rep: Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501
Is mysqld running and does /opt/liferay-5.2.3-1/mysql/tmp/mysql.sock exists?
 
Old 06-02-2010, 06:35 AM   #7
sawgata
LQ Newbie
 
Registered: May 2010
Posts: 15

Original Poster
Rep: Reputation: 0
Smile error in starting mysql

"Is mysqld running and does /opt/liferay-5.2.3-1/mysql/tmp/mysql.sock exists?"

mysqld is not even starting thats the error but the file mysql.sock is available in the location u stated.
liferay is working fine but mysqld is not starting.details are in my above post starting.
 
Old 06-02-2010, 06:48 AM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,516

Rep: Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501
You have to use the mysqld_safe that came with liferay to start mysqld:
Code:
/opt/liferay-5.2.3-1/mysql/bin/mysqld_safe --user=mysql &
Check if that's the correct path to mysqld_safe and change it accordingly if needed.
 
Old 06-02-2010, 07:22 AM   #9
sawgata
LQ Newbie
 
Registered: May 2010
Posts: 15

Original Poster
Rep: Reputation: 0
Smile

Quote:
Originally Posted by bathory View Post
you have to use the mysqld_safe that came with liferay to start mysqld:
Code:
/opt/liferay-5.2.3-1/mysql/bin/mysqld_safe --user=mysql &
check if that's the correct path to mysqld_safe and change it accordingly if needed.
with the above i am getting the following error
Quote:
Originally Posted by sawgata
[root@localhost ~]# /opt/liferay-5.2.3-1/mysql/bin/mysqld_safe start
100602 15:46:48 mysqld_safe logging to '/opt/liferay-5.2.3-1/mysql/data/localhost.localdomain.err'.
100602 15:46:48 mysqld_safe a mysqld process already exists
 
Old 06-02-2010, 07:31 AM   #10
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,516

Rep: Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501
Quote:
100602 15:46:48 mysqld_safe a mysqld process already exists
Run
Code:
ps -ef|grep mysqld
and manually kill any mysqld processes. Then try again
 
  


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
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock welery Linux - Software 19 03-06-2014 08:19 AM
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) sammy007 Linux - Networking 1 01-30-2010 07:32 AM
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13) Pode Slackware 12 11-26-2008 09:21 AM
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' mathimca05 Linux - Newbie 2 10-17-2007 03:04 AM
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) sunlinux Linux - Software 1 11-07-2006 01:08 AM


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