1

I am trying to start a second mysqld instance to restore data from backup (innoDB).

Following the manual I put together this:

P="/var/lib/reoback/backups/2014-06-30/var/lib/mysql"
cd $P
mkdir tmp
touch mysql.log
chown -R mysql:mysql .
# mysqld v5.0
mysqld --console --port=3399 --socket=/var/run/mysqld/mysqld.sock --datadir=$P /
   --pid-file=$P/mysqld.pid --log=$P/mysql.log --log-bin=$P/bin.log /
   --log-error=$P/error.log --tmpdir=$P/tmp --innodb_force_recovery=6 

and ended up crashing my running instance.

Question is: How do I create a second mysqld instance using the backup folder?

4
  • You need to look in the logs that the crashed instance wrote. – user9517 Jul 2 '14 at 11:30
  • @Iain Well, it did not write any logs. I had some console output but I lost that while I restored the main instance. Can't try that again. That's why I am here to make it save this time. – PiTheNumber Jul 2 '14 at 11:37
  • $P/error.log ? And without logs we can only guess – user9517 Jul 2 '14 at 11:39
  • @Iain no error.log and mysql.log is empty. I don't know why... – PiTheNumber Jul 2 '14 at 11:40
1

Yes I would say you need a second socket. You can create one it using mkfifo - but maybe MySQL should recreate it on its own.

1

Try this:

P="/var/lib/reoback/backups/2014-06-30/var/lib/mysql"
chown -R mysql:mysql $P
# mysqld v5.0
mysqld --port=3399 --socket=$P/mysqld.sock --datadir=$P \
    --pid-file=$P/mysqld.pid \
    --log-error=$P/error.log 

If it does't start, check $P/error.log why

3
  • you're saying the instance is crashing. I wonder how backup was taken and how do you know it's crashing – akuzminsky Jul 2 '14 at 14:03
  • Thank you I will try that. I know the current instance was crashing because the website went down with DB error and mysqld restart failed. After I kill -9 mysqld it did start again. What you are chainging is mainly to remove --console and --innodb_force_recovery, right? Changing log path and tmp probably does not hurt I guess. – PiTheNumber Jul 2 '14 at 14:55
  • 1
    right, you don't need --console as long as you logging to a file. innodb_force_recovery has its use but not applicable in your case. The major problem was a socket potentially at the same destination as for the main instance and you chown-ed tmp directory, not $P – akuzminsky Jul 2 '14 at 16:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.