MySql not getting started

Installing, Configuring, Troubleshooting server daemons such as Web and Mail
midhunv
Posts: 11
Joined: 2016/05/10 14:57:32

MySql not getting started

Post by midhunv » 2016/05/11 17:39:02

I have a issue with mysql,It shows error in .etc/conf in line 1.what shall be the error ,pls help

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: MySql not getting started

Post by gerald_clark » 2016/05/11 17:50:24

Show exact error message. We are not psychic.

midhunv
Posts: 11
Joined: 2016/05/10 14:57:32

Re: MySql not getting started

Post by midhunv » 2016/05/12 13:35:32

[root@localhost ~]# service mysqld start
error: Found option without preceding group in config file: /etc/my.cnf at line: 1
Fatal error in defaults handling. Program aborted
error: Found option without preceding group in config file: /etc/my.cnf at line: 1
Fatal error in defaults handling. Program aborted
error: Found option without preceding group in config file: /etc/my.cnf at line: 1
Fatal error in defaults handling. Program aborted
error: Found option without preceding group in config file: /etc/my.cnf at line: 1
Fatal error in defaults handling. Program aborted
MySQL Daemon failed to start.
Starting mysqld: [FAILED]

midhunv
Posts: 11
Joined: 2016/05/10 14:57:32

Re: MySql not getting started

Post by midhunv » 2016/05/12 13:35:59

This is what i get ,what should be the issue?

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: MySql not getting started

Post by gerald_clark » 2016/05/12 13:42:55

Fix your config files as the messages indicate.

midhunv
Posts: 11
Joined: 2016/05/10 14:57:32

Re: MySql not getting started

Post by midhunv » 2016/05/12 13:53:41

If I had known how to fix it ,I wouldn't have posted anything in here ,Folks who can help ,pls guide me ,Tnx

User avatar
TrevorH
Forum Moderator
Posts: 22777
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: MySql not getting started

Post by TrevorH » 2016/05/12 14:09:55

No one can help if you don't post enough information. Since it's complaining about the syntax in your config file you will need to post your config file.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

midhunv
Posts: 11
Joined: 2016/05/10 14:57:32

Re: MySql not getting started

Post by midhunv » 2016/05/12 14:21:30

[mysqld]
service mysqld start
cp /etc/my.cnf /etc/my.cnf.original
echo "" > /etc/my.cnf
[mysql.server]
user = mysql
#basedir = /var/lib

[client]
port = 3306
socket = /var/lib/mysql/mysql.sock

[mysqld]
datadir = /var/lib/mysql
#tmpdir = /home/mysql_tmp
socket = /var/lib/mysql/mysql.sock
user = mysql
old_passwords = 0
ft_min_word_len = 3
max_connections = 800
max_allowed_packet = 32M
skip-external-locking

log-error = /var/log/mysqld/mysqld.log

query-cache-type = 1
query-cache-size = 32M

long_query_time = 1
#slow_query_log = 1
#slow_query_log_file = /var/log/mysqld/slow-queries.log

tmp_table_size = 128M
table_cache = 1024

join_buffer_size = 1M
key_buffer = 512M
sort_buffer_size = 6M
read_buffer_size = 4M
read_rnd_buffer_size = 16M
myisam_sort_buffer_size = 64M

max_tmp_tables = 64

thread_cache_size = 8
thread_concurrency = 8

# If using replication, uncomment log-bin below
#log-bin = mysql-bin

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash

[isamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

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

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: MySql not getting started

Post by gerald_clark » 2016/05/12 15:46:13

That first [mysqld] section is garbage.
I suggest reading the documentation at
http://dev.mysql.com/doc/ that covers the configf files.

midhunv
Posts: 11
Joined: 2016/05/10 14:57:32

Re: MySql not getting started

Post by midhunv » 2016/05/12 16:15:05

Sorry ,It was my Mistake ,Tried without mysqld at line 1 ,then the error shws as i pasted ,When i add mysqld at line 1 ,it simply demon failed .
what to do?

Post Reply