Solved

ERROR 2002: Can't connect to local MySQL server through socket

Posted on 2006-10-26
27
1,463 Views
Last Modified: 2008-01-09
Hi all im t rying to run this web application called vtigerCRM, I run the script that starts it all up, but I get this error:

Starting apache at port 81


MySQL home: /vtiger/vtigerCRM4_2/mysql


Checking  whether the MySQL server is already running

ERROR 2002: Can't connect to local MySQL server through socket '/vtiger//vtigerCRM4_2/mysql/mysql.socket' (2)

Mysql Server is not running. Going to start the  mysql server at port 3308

rm: cannot remove `/var/run/mysqld/mysqld.pid': Permission denied
./bin/mysqld_safe: line 281: /var/log/mysqld.log: Permission denied
ERROR 2002: Can't connect to local MySQL server through socket '/vtiger//vtigerCRM4_2/mysql/mysql.socket' (2)

****************************************************************************
Unable to start the mysql server. Check whether the port 3308 is free



Any ideas? seems a bit straight forward
0
Comment
Question by:thechase22
  • 14
  • 9
  • 3
  • +1
27 Comments
 
LVL 6

Expert Comment

by:chigs20
ID: 17812947
Vtiger CRM is a bundled package so you don't have as much control over the individual installation of components.
Is this error produced during installation?
Is the installation successful but it just can't connect to mysql?

To see if mysql is running:
shell> nmap -sT localhost

This will show you all ports and services that are currently running.
0
 
LVL 1

Author Comment

by:thechase22
ID: 17817562
Hey and thanks ever so much for your reply.

Correct, installation was successful thank god, I had a nightmare with the apache, but that on its own had its own problem, took me 5 days to figure out, I had to disable SElinux in the text file.

Ill try what you said when I get to work though.
0
 
LVL 1

Author Comment

by:thechase22
ID: 17832429
Still isnt working and im getting the same error, anything else we can try?
0
 
LVL 1

Author Comment

by:thechase22
ID: 17841278
Ok sorry I didnt type the command in properly, I get this corrently:

(The 1665 ports scanned but not shown below are in state: closed)
PORT      STATE SERVICE
22/tcp    open  ssh
25/tcp    open  smtp
111/tcp   open  rpcbind
631/tcp   open  ipp
3306/tcp  open  mysql
8080/tcp  open  http-proxy
10000/tcp open  snet-sensor-mgmt
50000/tcp open  iiimsf
50002/tcp open  iiimsf

Thing is, the mysql, runs oin port 3308, so 3306 like you currently see, shouldnt matter?
0
 
LVL 6

Expert Comment

by:chigs20
ID: 17843090
So in your original post it says, "Mysql Server is not running. Going to start the mysql server at port 3308"
Somewhere in the code its pointing to the wrong port.  IMHO, I'm not sure how to fix this so you may want to post this on the vTiger Forum page or circle an email.
0
 
LVL 1

Author Comment

by:thechase22
ID: 17850758
Ok good, at least I have some direction, I think it is a mysql problem, because I have searched the error and alot of people have that error.

Could you possibly direct me to what file mysql uses to start etc, the config file perhaps so I could search around, the Vtiger forums are rubish, and I seem to always get my problems sorted on this site :)
0
 
LVL 6

Accepted Solution

by:
chigs20 earned 250 total points
ID: 17850849
MySQL can be installed in any directory... from your post it appears to be in: /vtiger//vtigerCRM4_2/mysql/
And it used a binary distribution, probably a .tar file.  All the data, indices, and log files will be in that directory also.
The config file will end with .cnf (usually /etc/my.cnf).

0
 
LVL 1

Author Comment

by:thechase22
ID: 17856603
I did a search, and there isnt one in there, is there a chance I have to create one, perhaps use a sample.cnf or something? Maybe I could use the master mysql my.cnf and ammend it for vtiger, what do you reckon?
0
 
LVL 10

Expert Comment

by:mbvvsatish
ID: 17857570
/etc/init.d/mysql.server is the file that is used to start or stop the server

chigs20 is correct.
vTiger is trying to look for mysql whether it is running on port 3308 or not. if not it is trying to start the server at 3308.
but actually your mysql is running under 3306 port.
so check the vTiger forums for point the mysql port to 3306 instead of 3308.
or else you can change the port of your mysql to 3308.

stop the mysql server if running using the followin command
/etc/init.d/mysql.server stop
open my.cnf available under /etc/my.cnf
and add this line just under [mysqld], i.e.,
[mysqld]
port = 3308

now start the mysql usign
/etc/init.d/mysql.server start

0
 
LVL 1

Author Comment

by:thechase22
ID: 17858557
so let me get this straight, the file under /etc/my.cnf controls all instances of mysql? regardless of which type of application uses its own mysql, also if your running mysql on different ports, u need this file??

Im gonna try the things you just said, but I just wanted to ask that question.
0
 
LVL 10

Expert Comment

by:mbvvsatish
ID: 17864303
yes you are right.
my.cnf is not a mandatory file, even if the file doesnt exist mysql works, but with default settings.
using my.cnf you can change the settings of mysql, fine tune mysql...etc..etc
0
 
LVL 1

Author Comment

by:thechase22
ID: 17867162
Now im getting this error:

Starting apache at port 81

httpd not running, trying to start

MySQL home: /vtiger/vtigerCRM4_2/mysql


Checking  whether the MySQL server is already running

warning: World-writeable config file /etc/my.cnf is ignored
ERROR 2002: Can't connect to local MySQL server through socket '/vtiger//vtigerCRM4_2/mysql/mysql.socket' (2)

Mysql Server is not running. Going to start the  mysql server at port 3308

warning: World-writeable config file /etc/my.cnf is ignored
warning: World-writeable config file /etc/my.cnf is ignored
warning: World-writeable config file /etc/my.cnf is ignored

Checking if the vtigercrm4_2_4 database already exists

warning: World-writeable config file /etc/my.cnf is ignored


Thing is, the webpage now displays, although no one likes errors lol, so is this something I can fix easy?
0
 
LVL 10

Expert Comment

by:mbvvsatish
ID: 17867902
paste the contents of your my.cnf here.
btw what is the version of your mysql
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 10

Expert Comment

by:mbvvsatish
ID: 17867934
if possible try to paste the contents of the shell script also.
we will see what the shell script is trying to do.
0
 
LVL 4

Expert Comment

by:Sheeri
ID: 17868695
chmod a-w /etc/my.cnf

take away the world-writeable permissions and try again?
0
 
LVL 1

Author Comment

by:thechase22
ID: 17915209
This is what I got, I couldnt do your command Sheeri, ohh wait let me try as SU...

[mysqld]
port = 3308
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
     
[mysql.server]
user=mysql
basedir=/var/lib

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

0
 
LVL 10

Expert Comment

by:mbvvsatish
ID: 17915483
>datadir=/var/lib/mysql
this should be
datadir=/var/lib/mysql/data

and
>basedir=/var/lib
should be
basedir=/var/lib/mysql
0
 
LVL 1

Author Comment

by:thechase22
ID: 17915542
I have a question, since im using a separate mysql, for this application vtiger, is there any way I can check if its really using this file, because etc/my.cnf is the master mysql file.

Just curious...
0
 
LVL 10

Expert Comment

by:mbvvsatish
ID: 17915581
what do you mean by using separate mysql?
0
 
LVL 1

Author Comment

by:thechase22
ID: 17915642
did you not read my post?

Vtiger uses its own mysql.

But for some reason there is no my.cnf file in the vtiger/mysql directory
0
 
LVL 10

Expert Comment

by:mbvvsatish
ID: 17915827
ok then.
change the my.cnf so that the vtiger picks this my.cnf
>warning: World-writeable config file /etc/my.cnf is ignored
since your my.cnf has doesnt point to vtiger/mysql it is ignoring it.

change you my.cnf to point to your vtiger/mysql

[mysqld]
port = 3308
datadir=/vtiger/vtigerCRM4_2/mysql/data
socket=/vtiger/vtigerCRM4_2/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
     
[mysql.server]
user=mysql
basedir=/vtiger/vtigerCRM4_2/mysql

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

>>rm: cannot remove `/var/run/mysqld/mysqld.pid': Permission denied
>>./bin/mysqld_safe: line 281: /var/log/mysqld.log: Permission denied
the above error could be because of your mysql server is using these files but vtiger/mysql is trying to remove them.
so first stop you own mysql server and allow only vtiger/mysql to run.

stop your mysql server if running using the followin command
/etc/init.d/mysql.server stop

if you want to run both mysql servers in the same machine with different ports, there are lot of things to do.
just like that it will not work. so dont allow your mysql to run as of now.
0
 
LVL 1

Author Comment

by:thechase22
ID: 18001741
Ok let me try what you just said, but how hard is it to run 2 mysqls?

Because I want to run mysql for this vtiger, and mysql for just normal linux, for my testing etc, I dont know why vtiger can't just make its own my.cnf, it does the rest of the files, or cant it work like that?
0
 
LVL 1

Author Comment

by:thechase22
ID: 18026925
Could you point me in the right direction in runnin 2 mysql's at the same time?
0
 
LVL 10

Assisted Solution

by:mbvvsatish
mbvvsatish earned 250 total points
ID: 18027003
0
 
LVL 1

Author Comment

by:thechase22
ID: 18044316
ok some of the links im still checking out, but heres one that will give your brain a hard time, im still getting this error

./bin/mysqld: File './vtslowquery.log' not found (Errcode: 13)

Warning: World-writable config file '/vtigercrm-5.0.2/vtigerCRM5/mysql/my.cnf' is ignored

Is it permissions still?
0
 
LVL 10

Expert Comment

by:mbvvsatish
ID: 18044516
>>./bin/mysqld: File './vtslowquery.log' not found (Errcode: 13)
vtiger is trying to log slow queries, but it is unable to find the log file.
so you need to specify the slow query log in my.cnf.

log-slow-queries = ./vtslowquery.log
0
 
LVL 1

Author Comment

by:thechase22
ID: 18084249
everything is workiong now, dont ask me why, but for some reason, the php.ini in the directory had wrong permissions, I 777 them, and I loswt all the errors, strange that.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
I use MySQL for many of my development projects in a Windows environment. To manage my databases (and perform queries) for years I used a tool called MySQL administrator.  This tool has since been replaced by MySQL Workbench. So I decided to m…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now