LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 09-27-2011, 06:16 AM   #1
dot_pro
LQ Newbie
 
Registered: Sep 2011
Posts: 2

Rep: Reputation: Disabled
MySQL (mysqld) fails to start!


Hello,

I have recently installed MySql and I encourage an error.
I am using Fedora 15 and when I am trying to start mysqld service i am getting
the following error message:
Quote:
Starting mysqld (via systemctl): Job failed. See system logs and 'systemctl status' for details. [FAILED]
If I try to start it from Service Configuration GUI it fails too.

Checking the system logs it just says:
Quote:
Sep 27 11:49:11 mp054a systemd[1]: mysqld.service: control process exited, code=exited status=1
Sep 27 11:49:11 mp054a systemd[1]: Unit mysqld.service entered failed state.
If I try to type 'msql' from command line I am getting the following error
msg:
Quote:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
I have read about the /etc/my.cnf file and I tried to edit it somehow
but with no success.
My /etc/my.cnf contains the following:
Quote:
[mysqld]
#datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
max_connections=125
table_cache=2500
thread_cache_size=100
thread_stack=250K
wait_timeout=10
join_buffer=5M
myisam_sort_buffer_size=15M
query_cache_size=15M
read_rnd_buffer_size=5M
default-character-set=utf8
default-collation=utf8_unicode_ci
character-set-server=utf8
collation-server=utf8_unicode_ci

[mysql.server]
user=mysql
#basedir=/var/lib
old-passwords = 1

[client]
default-character-set=utf8

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

Note that I have commented datadir and basedir. That's because I had the same mysqld problem yesterday and I found online that if I comment them it might work.And indeed the problem solved.
But later I tried to install moodle and I had to make some changes to the permission of some folders over /var/ directory. I had to play a little bit and in the end I manage to figure permissions in such a way that moodle was working. (Note that permission changes have been made after I managed to start mysqld successfully).

Today when I power my computer on and tried to restart httpd and mysqld, the latter one failed.

If I uncomment datadir and basedir mysqld still fails to start.

If I do 'ls -la /var/lib' I am getting the following about mysql:
Quote:
drwxr-xr-x. 5 mysql mysql 4096 Sep 27 11:49 mysql
If I do 'ls -la /var/lib/mysql' I am getting the contents of mysql:
Quote:
drwxr-xr-x. 5 mysql mysql 4096 Sep 27 11:49 .
drwxr-xr-x. 41 root root 4096 Sep 26 22:04 ..
-rwxr-xr-x. 1 mysql mysql 35651584 Sep 27 11:49 ibdata1
-rwxr-xr-x. 1 mysql mysql 5242880 Sep 27 11:49 ib_logfile0
-rwxr-xr-x. 1 mysql mysql 5242880 Sep 27 11:49 ib_logfile1
drwxr-xr-x. 2 mysql mysql 20480 Sep 26 17:07 moodle
-rwxr-xr-x. 1 mysql mysql 35556 Sep 27 11:49 mp054a.halls.manchester.ac.uk.err
drwxr-xr-x. 2 mysql mysql 4096 Sep 26 02:29 mysql
drwxr-xr-x. 2 mysql mysql 4096 Sep 26 02:29 performance_schema
I have noticed that if I do 'ls -la /tmp/' I can see the following about mysql.sock:
Quote:
lrwxrwxrwx. 1 mysql mysql 25 Sep 26 03:13 mysql.sock -> /var/lib/mysql/mysql.sock
whereas I cannot find anything about mysql.sock on /var/lib/mysql

I tried to change socket to 'socket=/tmp/mysql.sock' in the my.cnf and
nothing changes.

I am not an expert user on linux. I hope the details I added above can
help you help me

I would appreciate any help. Thanks in advace!
 
Old 09-27-2011, 02:56 PM   #2
dot_pro
LQ Newbie
 
Registered: Sep 2011
Posts: 2

Original Poster
Rep: Reputation: Disabled
I found the solution. The problem was in the /etc/my.cnf file.
The two commands
Quote:
default-character-set=utf8
default-collation=utf8_unicode_ci
have been deprecated. So if I comment them everything is fine:


Quote:
...
#default-character-set=utf8
#default-collation=utf8_unicode_ci
character-set-server=utf8
collation-server=utf8_unicode_ci
 
  


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
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
fails to start syslogd and mysqld after moving /var to new partition jweller Red Hat 8 03-27-2008 02:32 PM
mandriva fails to start /etc/init.d/mysqld johnnysd Linux - Server 4 11-24-2006 11:23 AM
MySQL: mysqld start for 2 sec bato Fedora 2 04-03-2006 01:50 PM


All times are GMT -5. The time now is 02:49 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration