Jump to content

Stop MySQL service


AP81

Recommended Posts

Hi guys,

I am trying to do the following (with no luck):

1.stop the MySQL service
2.copy database tables into the mysql dir
3.start MySQL again

PHP fails with the following:
passthru/exec/system('service mysqld stop', $retval);
passthru/exec/system('/etc/init.d/mysqld stop', $retval);
passthru/exec/system('/media/datadrive/stopmysql.sh', $retval);

MySQL hotcopy or MySQL dump is not an option.  I have been told my backups and restores must be done manually (i.e.
Stop MySQL, copy tables to MySQL dir -OR- backup tables, start MySQL.  I have the backups working fine, which is a cron task done every day, it is just automating a restore via PHP which is causing me headaches.

Any help is appreciated.

Thanks,
Adam
Link to comment
https://forums.phpfreaks.com/topic/32541-stop-mysql-service/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.