You are not logged in.
I want to backup mysql locking tables first using flush tables with readlock, then do rsync and then unlock tables.
I want to do it automatically using script.
When I log in to mysql using: mysql -u root -p
the command:
FLUSH TABLES WITH READ LOCK;
works and locks the tables...but when I create my.cnf with login information to mysql:
[client]
user=root
password=xxx
the command:
mysql -e "SHOW DATABASES"
works and shows the databases....
but when I run this command:
mysql -e "FLUSH TABLES WITH READ LOCK"
it doesnt lock the tables...why?
thanks
Offline
Are calling the 'mysql -e' command as your user or as root? If you call it as root (typical for a backup script), then the .my.cnf file needs to be in /root instead of $HOME.
Scott
Offline