Backing up MySQL

I’ve got a HTPC with all my media on and Kodi installed and I also have a Raspberry Pi 2 running OSMC and is also a MySQL server where my library is located. What I cannot seem to get working is backing up the MySQL database from the RPi to my HTPC. I did have MySQL running on my HTPC and I have been trying to use the mysqldump tool and specifying the host as my RPi but so far I’ve been unsuccessful.

How can I backup my databases from my RPi onto my HTPC? I would like to automate it if possible but if not I can live with a manual backup

So you are trying to backup your mysql server that is running on OSMC from your HTPC? Does the user you are using for the backup has the right to access the database from the the HTPC as a host? Check your user rights within MYSQL.

I believe there is only 1 user setup in MySQL. I’m sure I’ve also tried as root but still not managed to do it

But you still need to ensure that user has the respctive rights to access from the IP address of the HTPC.
Post the output of select * from user;

I see. I’ve attached the output of that query as a JPG as it was a mess when pasted in here.

The 192. host I added a minute ago to see if it worked but it didn’t. The message I get is “The device is not ready” which doesen’t suggest an authentication error?

I did have MySQL running on the HTPC but it was a bad idea. I disabled the MySQL service but left everything else installed so I am using that MySQL dump to get this backup. Is that what is causing the issue maybe? Do I need to use a different utility?

Does the -v (verbose) flag give any further info that could point to the issue?

Nope didn’t help. Although I have just spotted the reason it doesen’t work. I’m trying to dump the SQL to D drive but I don’t have a D drive :grin:I changed it to the correct path and it works perfectly.

Thats what happens when you look at something too long, you miss the obvious!

1 Like