LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-11-2015, 07:59 AM   #1
willc86
Member
 
Registered: Dec 2014
Posts: 56

Rep: Reputation: Disabled
mysqld and selinux? cant start mysqld


hey guys hopefully someone has the answers for this but
these are my errors

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib /mysql/mysql.sock' (2)

and in my /etc/log/mysqld.log

150403 0:30:26 [Note] /usr/libexec/mysqld: Shutdown complete
150403 00:30:26 mysqld ended
150403 00:58:32 mysqld started
150403 0:58:32 [Warning] Can't create test file /mnt/xfsdisk/mysql/cts4348-node-8.lower-test
150403 0:58:32 [Warning] Can't create test file /mnt/xfsdisk/mysql/cts4348-node-8.lower-test
/usr/libexec/mysqld: Can't change dir to '/mnt/xfsdisk/mysql/' (Errcode: 13)
150403 0:58:32 [ERROR] Aborting


and this is my.cnf file

[mysqld]
datadir=/mnt/xfsdisk/mysql/
socket=/mnt/xfsdisk/mysql/mysql.sock
user=mysql


-----------------------------------

i tried these commands to fix them, but still sam eproblem


926 semanage fcontext -a -t mysqld_db_t /mnt/xfsdisk/mysql/
927 semanage fcontext -a -t mysqld_db_t /mnt/xfsdisk/
restorecon -Rv /mnt/xfsdisk/mysql/
semanage fcontext -a -t mysqld_db_t "/mnt/xfsdisk/mysql(/.*)?"


nothing seems to work? any ideas where to point me? (also I do not have a [client] in the my.cnf file.


i am also using centos5....the funny part is it was working just fine. i tried to install mantis but i dont know if that is the problem?

Last edited by willc86; 04-11-2015 at 08:05 AM.
 
Old 04-11-2015, 09:19 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by willc86 View Post
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
...you're connecting your mysql client to the mysql service over a specific socket name,

Quote:
Originally Posted by willc86 View Post
/usr/libexec/mysqld: Can't change dir to '/mnt/xfsdisk/mysql/' (Errcode: 13)
...but your mysql service isn't running,


Quote:
Originally Posted by willc86 View Post
socket=/mnt/xfsdisk/mysql/mysql.sock
...and your service socket is located somewhere else,


Quote:
Originally Posted by willc86 View Post
i tried these commands to fix them, but still sam eproblem
...and you haven't shown us ('grep mysql /var/log/audit/audit.log|audit2allow;') if SELinux is the problem.


Quote:
Originally Posted by willc86 View Post
also I do not have a [client] in the my.cnf file.
Decide if you need or want the default section after reading the documentation.


Quote:
Originally Posted by willc86 View Post
the funny part is it was working just fine. i tried to install mantis but i dont know if that is the problem?
It was your intention to install the Mantis bug tracker but you created or compounded problems by also chosing to change the default directory MySQL. Also note your "/mnt/xfsdisk" is line "/var/lib" and it MUST NOT have the same context as "/var/lib/mysql" or "/mnt/xfsdisk/mysql". So next to compounding things you also managed to skew things further. I suggest you restore everything back to defaults and then you will see the installation will work just OK. If you can't for some reason then ensure the fix you're applying is the correct one and please be precise applying it.
 
  


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
[SOLVED] MySQL Start Problem::::socket '/var/run/mysqld/mysqld.sock' (2) arun-linux Linux - Software 6 11-29-2012 06:56 AM
[SOLVED] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' Burningmace Linux - Server 5 09-06-2012 01:29 AM
Can't connect to local MySql server through socket '/var/run/mysqld/mysqld.sock' (2) thoufiq Linux - Server 4 04-19-2011 04:35 AM
Mysqld won't start with Selinux enforcing turned on jdnow09 Linux - General 3 06-24-2009 01:37 PM
mysqld start linuxRules Linux - General 1 07-21-2002 03:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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