I am trying to sync data from one mysql database living on one server to another (location with you).
I have a series of php scripts that package up the data, download it to the server and decompress it.. but I am having little joy in importing the data via command line.
I am running the terminal command
mysql -u dbusername -h blaa.mysql.eu1.frbit.com mypasswordhere database_name < /var/www/blaa/sqlfilehere.sql
Via php exec command.. I get no errors or anything show in the error log but nothing seems to import :( When I run the same command via terminal it works but says something along the lines of 'using your mysql password in the terminal is stupid'
Just wondering if there is a more sane way to do this via PHP so I don't have to do it by hand each time I want to sync..
So I ended up going with a php class that someone else put together here on github. Which did the job faster/better than I could have done in PHP and doesn't mess about with the command line.