2011-11-06, 03:24
When i upgraded to the latest nightly build I noticed that XBMC was trying to upgrade my database and appending a version number to the end of the database.
When I originally set up my permissions i restricted the xbmc user to the database xbmc.*
So when it tried to do the upgrades it didn't have the required permissions to create the new database XBMC57.
I decided to write this guide to make sure everyone can have painless upgraade without doing GRANT ALL PRIVILEGES ON *.*
The way I did this was to prefix all of my xbmc databases with "xbmc_"
So I now have:
I then changed my advancedsettings.xml to have the following as the xbmc database:
see the database name xbmc_video
Now all you have to do is run the following in mysql to setup permissions on your database:
My XBMC devices are all on my dhcp range so i have used the host '192.168.1.%' so that they can connect from anywhere in my LAN
Also you will see that the database is xbmc_%
This allows xbmc to do anything with it's databases and can't touch anything else that you may have running on your mysql server.
Next time you boot up your xbmc device and it needs to do a database upgrade different revisions will start appearing for example:
The same goes with the music database if you use it.
If you have any questions or suggestions to make this post better you are more than welcome to comment.
When I originally set up my permissions i restricted the xbmc user to the database xbmc.*
So when it tried to do the upgrades it didn't have the required permissions to create the new database XBMC57.
I decided to write this guide to make sure everyone can have painless upgraade without doing GRANT ALL PRIVILEGES ON *.*
The way I did this was to prefix all of my xbmc databases with "xbmc_"
So I now have:
Code:
mysql> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| xbmc_music |
| xbmc_video |
+--------------------+
4 rows in set (0.00 sec)
I then changed my advancedsettings.xml to have the following as the xbmc database:
Code:
<videodatabase>
<type>mysql</type>
<host>IPADDRESS</host>
<port>3306</port>
<user>USERNAME</user>
<pass>PASSWORD</pass>
<name>xbmc_video</name>
</videodatabase>
see the database name xbmc_video
Now all you have to do is run the following in mysql to setup permissions on your database:
Code:
GRANT USAGE ON *.* TO 'xbmc'@'192.168.1.%' IDENTIFIED BY '<INSERT PASSWORD>';
GRANT ALL PRIVILEGES ON `xbmc_%`.* TO 'xbmc'@'192.168.1.%';
My XBMC devices are all on my dhcp range so i have used the host '192.168.1.%' so that they can connect from anywhere in my LAN
Also you will see that the database is xbmc_%
This allows xbmc to do anything with it's databases and can't touch anything else that you may have running on your mysql server.
Next time you boot up your xbmc device and it needs to do a database upgrade different revisions will start appearing for example:
Code:
mysql> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| xbmc_music |
| xbmc_video |
| xbmc_video57 |
+--------------------+
5 rows in set (0.00 sec)
The same goes with the music database if you use it.
If you have any questions or suggestions to make this post better you are more than welcome to comment.