Solved

Timeout error on starting MySQL after adding Master for replication

Posted on 2008-10-27
9
781 Views
Last Modified: 2013-12-16
Hi All

I am trying to setup replication on my mysql server. I followed

http://www.howtoforge.com/mysql_database_replication

and added

log-bin = /var/log/mysql/mysql-bin.log
binlog-do-db=exampledb
server-id=1

To [mysqld]

After that I tried to restart mysql and I got the error below:

Timeout error occurred trying to start MySQL Daemon.

I am running CentOS 4.5.

Did I miss anything here ?

Thanks
0
Comment
Question by:http:// thevpn.guru
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
9 Comments
 
LVL 26

Expert Comment

by:ushastry
ID: 22813228
Can you please post the error log contents here...
Pls replace MySQlErrorLogFile.err with actual error log file(complete path).. error log should be n data dir

tail -n 100 MySQlErrorLogFile.err

BTW, Did you created schema named "exampledb" on master?
0
 
LVL 19

Author Comment

by:http:// thevpn.guru
ID: 22813343
tail -f  /var/log/mysqld.log

shows nothing

and yes the db exists on master
0
 
LVL 26

Expert Comment

by:ushastry
ID: 22813565
Pls check the error log... the log file which you shown seems to be general query log.
Error log should be created under data dir & has .err extension.. by default file naming is something host_name.err

Pls check my.cnf if it has an entry for the error log.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 19

Author Comment

by:http:// thevpn.guru
ID: 22813577
I checked no error log entries in my.cnf the only log entry is under [mysql_safe] if I want to add it under which section should i add it ?
0
 
LVL 26

Expert Comment

by:ushastry
ID: 22813710
should be under [mysqld]

mysqld_safe reads all options from the [mysqld], [server], and [mysqld_safe] sections in option files. For example, if you specify a [mysqld] section like this, mysqld_safe will find and use the --log-error option:

[mysqld]
log-error=/var/lib/mysqld.err
0
 
LVL 19

Author Comment

by:http:// thevpn.guru
ID: 22819879
Hi I did add

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

When I did the restart  I got
/usr/libexec/mysqld: File '/var/log/mysql/mysql-bin.index' not found (Errcode: 13)
081028  9:01:16 [ERROR] Aborting

I created that file however now it just says :

Timeout error occurred trying to start MySQL Daemon.
Starting MySQL:                                            [FAILED]

That is all I get even the error file is not throwing any error.
0
 
LVL 26

Accepted Solution

by:
ushastry earned 500 total points
ID: 22819906
From below error it seems some permission error..

/usr/libexec/mysqld: File '/var/log/mysql/mysql-bin.index' not found (Errcode: 13)

shell> perror 13
OS error code  13:  Permission denied

Can you please check whether or not mysql:mysql has writes on

/var/lib/mysql

MySQL keeps track of binary log index in mysql-bin.index..

Why Im asking you the error log file is bcoz mysql stores all the errors in it which are very useful in debugging and resolving most of the errors..
0
 
LVL 7

Expert Comment

by:macker-
ID: 22837152
The principal problem is where you're trying to write the file to.

log-bin = /var/log/mysql/mysql-bin.log

You're trying to write the binary log to /var/log/mysql/.  /var/log/mysql is meant for log output from syslog and similar, while binary logs are actual mysql datafiles for the database.

Try changing your log-bin line to:

log-bin = /var/lib/mysql/mysql-bin

Next make sure that whatever db follows 'binlog-do-db=' does actually exist.  So if you want to replicate the database named 'test', you'd have:

binlog-do-db=test


You should also refer to the excellent MySQL documentation on replication, found at:

http://dev.mysql.com/doc/refman/5.0/en/replication-implementation.html
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
reverse engineer .sql from php files 11 52
check mysql insert 12 41
what is the best way to connect my database to my new website using php and mysql ? 6 75
Linux 3 34
Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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.

756 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