Always keep xbmc_video as "current".
#1
So with the explosion of everyone having fun with MySQL. I just propose one change: Always keep "$database" as the current version. Before upgrade archive off the previous version to "$database$version".

Some of us have backup scripts, mysql slave servers, tools and other fun stuff that gets broken every time the version number changes.

For example I run a nightly script to backup my database in case anything happens:
"mysqldump xbmc_video -u xbmc -p xbmc | gzip > xbmc_video.sql.gz"

Now every time the database number changes, this script is just going to be archiving off old data. However, in my proposed change. You save a backup to xbmc_video50 before moving to xbmc_video51. The "xbmc_video" is version 51, version 50 is safe and backed up, and everything works as intended.
Code:
GRANT ALL PRIVILEGES ON `xbmc_%`.* TO 'xbmc'@'%';
IF you have a mysql problem, find one of the 4 dozen threads already open.
Reply
#2
+10 for this - as of the exact same backup reason Smile
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#3
Ticketed:
http://trac.xbmc.org/ticket/12209
Code:
GRANT ALL PRIVILEGES ON `xbmc_%`.* TO 'xbmc'@'%';
IF you have a mysql problem, find one of the 4 dozen threads already open.
Reply
#4
I think this is a great idea as well
Reply
#5
Memphiz Wrote:+10 for this - as of the exact same backup reason Smile

Memphiz or anyone else: if you're running anything that can run 'logrotate' which automates the whole thing more or less.

Inside of /etc/logrotate.d I created a file "xbmc_video"
Code:
/var/backups/xbmc_video.sql.gz {
    daily
    rotate 14
    nocompress
    create 640 root adm
    postrotate
        mysqldump xbmc_video57 -u xbmc -pxbmc > /var/backups/xbmc_video.sql
        mysql -h [offsite server] -u [user] -ppropradr [pass] < /var/backups/xbmc_video.sql
        gzip -9f /var/backups/xbmc_video.sql    
         #rsync -az /var/backups/xbmc_video.sql –password-file /root/rsync.password remote@server::backup
    endscript
}

Run it for the first time with:
Code:
touch /var/backups/xbmc_video.sql.gz
logrotate -f /etc/logrotate.d/xbmc_video

You should now have an automatic rolling backup.
Code:
GRANT ALL PRIVILEGES ON `xbmc_%`.* TO 'xbmc'@'%';
IF you have a mysql problem, find one of the 4 dozen threads already open.
Reply
#6
please do this, im a newb to the mySQL stuff and was only able to set it up through a lifehacker tutorial so im stuck using a nightly from early October due to my own ineptitude.
Reply
#7
sam: this won't help you. It'll only help the people that backup their databases with an automated script.

Someone needs to contact life hacker and get them to edit or remove their article.
Code:
GRANT ALL PRIVILEGES ON `xbmc_%`.* TO 'xbmc'@'%';
IF you have a mysql problem, find one of the 4 dozen threads already open.
Reply

Logout Mark Read Team Forum Stats Members Help
Always keep xbmc_video as "current".0