Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1506
  • Last Modified:

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

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
thechase22
Asked:
thechase22
  • 14
  • 9
  • 3
  • +1
2 Solutions
 
chigs20Commented:
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
 
thechase22Author Commented:
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
 
thechase22Author Commented:
Still isnt working and im getting the same error, anything else we can try?
0
Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

 
thechase22Author Commented:
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
 
chigs20Commented:
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
 
thechase22Author Commented:
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
 
chigs20Commented:
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
 
thechase22Author Commented:
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
 
mbvvsatishCommented:
/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
 
thechase22Author Commented:
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
 
mbvvsatishCommented:
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
 
thechase22Author Commented:
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
 
mbvvsatishCommented:
paste the contents of your my.cnf here.
btw what is the version of your mysql
0
 
mbvvsatishCommented:
if possible try to paste the contents of the shell script also.
we will see what the shell script is trying to do.
0
 
SheeriCommented:
chmod a-w /etc/my.cnf

take away the world-writeable permissions and try again?
0
 
thechase22Author Commented:
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
 
mbvvsatishCommented:
>datadir=/var/lib/mysql
this should be
datadir=/var/lib/mysql/data

and
>basedir=/var/lib
should be
basedir=/var/lib/mysql
0
 
thechase22Author Commented:
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
 
mbvvsatishCommented:
what do you mean by using separate mysql?
0
 
thechase22Author Commented:
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
 
mbvvsatishCommented:
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
 
thechase22Author Commented:
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
 
thechase22Author Commented:
Could you point me in the right direction in runnin 2 mysql's at the same time?
0
 
thechase22Author Commented:
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
 
mbvvsatishCommented:
>>./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
 
thechase22Author Commented:
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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 14
  • 9
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now