MySQL/Setting up MySQL: Difference between revisions
< MySQL
Jump to navigation
Jump to search
(→Ubuntu Linux: {{kodi}} name change) |
({{kodi}} name changes) |
||
Line 22: | Line 22: | ||
#Get into the MySQL command line utility: <code>$mysql -u root -p</code> | #Get into the MySQL command line utility: <code>$mysql -u root -p</code> | ||
#Enter the following commands: | #Enter the following commands: | ||
##Type in: <code>CREATE USER 'kodi' IDENTIFIED BY ' | ##Type in: <code>CREATE USER 'kodi' IDENTIFIED BY 'kodi';</code> and press return | ||
##Type in: <code>GRANT ALL ON *.* TO 'kodi';</code> and press return | ##Type in: <code>GRANT ALL ON *.* TO 'kodi';</code> and press return | ||
#Close out the command line tool with <code>\q</code> | #Close out the command line tool with <code>\q</code> | ||
Line 35: | Line 35: | ||
#Get into the MariaDB command line utility: <code>$ mysql -u root -p</code> | #Get into the MariaDB command line utility: <code>$ mysql -u root -p</code> | ||
#Enter the following commands: | #Enter the following commands: | ||
##Type in: <code>CREATE USER ' | ##Type in: <code>CREATE USER 'kodi' IDENTIFIED BY 'kodi';</code> and press return | ||
##Type in: <code>GRANT ALL ON *.* TO ' | ##Type in: <code>GRANT ALL ON *.* TO 'kodi';</code> and press return | ||
#Close out the command line tool with <code>\q</code> | #Close out the command line tool with <code>\q</code> | ||
Line 51: | Line 51: | ||
#*Enter your MySQL root password as set above, or just press enter if you didn't set one to log in with a blank password | #*Enter your MySQL root password as set above, or just press enter if you didn't set one to log in with a blank password | ||
#Enter the following commands: | #Enter the following commands: | ||
##Type in: <code>CREATE USER ' | ##Type in: <code>CREATE USER 'kodi' IDENTIFIED BY 'kodi';</code> and press return | ||
##Type in: <code>GRANT ALL ON *.* TO ' | ##Type in: <code>GRANT ALL ON *.* TO 'kodi';</code> and press return | ||
#Close out the command line tool with <code>\q</code> | #Close out the command line tool with <code>\q</code> | ||
Line 59: | Line 59: | ||
#Download a copy of MySQL server from http://dev.mysql.com/downloads/mysql/ | #Download a copy of MySQL server from http://dev.mysql.com/downloads/mysql/ | ||
#In Mac OS X, go to System Preferences -> MySQL, and click on “Start MySQL Server”. You’ll also want to tick to enable the “Automatically … on Startup” option. | #In Mac OS X, go to System Preferences -> MySQL, and click on “Start MySQL Server”. You’ll also want to tick to enable the “Automatically … on Startup” option. | ||
#Now to set up the " | #Now to set up the "kodi" user in MySQL and give it access. Launch Terminal.app on your Mac and issue the following commands, one line at a time: | ||
##<code>sudo /usr/local/mysql/bin/mysql</code> | ##<code>sudo /usr/local/mysql/bin/mysql</code> | ||
##<code>CREATE USER ' | ##<code>CREATE USER 'kodi' IDENTIFIED BY 'kodi';</code> | ||
##<code>GRANT ALL ON *.* TO ' | ##<code>GRANT ALL ON *.* TO 'kodi';</code> | ||
##<code>exit</code> | ##<code>exit</code> | ||
#Remain in Terminal.app. Now you'll be giving other computers on your network access to MySQL. Enter the next set of commands, one line at a time: | #Remain in Terminal.app. Now you'll be giving other computers on your network access to MySQL. Enter the next set of commands, one line at a time: | ||
Line 113: | Line 113: | ||
#Open the "MySQL Command Line Client" from the MySQL start menu | #Open the "MySQL Command Line Client" from the MySQL start menu | ||
#Enter the following commands: | #Enter the following commands: | ||
##Type in: <code>CREATE USER ' | ##Type in: <code>CREATE USER 'kodi' IDENTIFIED BY 'kodi';</code> and press return | ||
##Type in: <code>GRANT ALL ON *.* TO ' | ##Type in: <code>GRANT ALL ON *.* TO 'kodi';</code> and press return | ||
#Close out the command line tool | #Close out the command line tool | ||
Line 198: | Line 198: | ||
* <code>CREATE USER ' | * <code>CREATE USER 'kodi' IDENTIFIED BY 'kodi';</code> | ||
* <code>GRANT ALL ON *.* TO ' | * <code>GRANT ALL ON *.* TO 'kodi';</code> | ||
* <code>quit;</code> | * <code>quit;</code> | ||
Line 205: | Line 205: | ||
'''Optional:''' '''If you only use the MySQL server for XBMC and that server has non-critical data on it, then this probably not necessary.''' | '''Optional:''' '''If you only use the MySQL server for XBMC and that server has non-critical data on it, then this probably not necessary.''' | ||
For a more secure MySQL installation use these 2 commands to grant permission only to databases XBMC uses. This is useful if you plan on using your MySQL server for more than just XBMC, or if you're worried about your internal network being exposed and wanting to lock things down more, etc. | For a more secure MySQL installation use these 2 commands to grant permission only to databases XBMC uses. This is useful if you plan on using your MySQL server for more than just XBMC, or if you're worried about your internal network being exposed and wanting to lock things down more, etc. | ||
#<code>GRANT ALL ON `MyMusic%`.* TO ' | #<code>GRANT ALL ON `MyMusic%`.* TO 'kodi'@'%' IDENTIFIED BY 'kodi';</code> | ||
#<code>GRANT ALL ON `MyVideos%`.* TO ' | #<code>GRANT ALL ON `MyVideos%`.* TO 'kodi'@'%' IDENTIFIED BY 'kodi';</code> | ||
{{Divbox|orange|| | {{Divbox|orange|| | ||
The limited grants on this page don't give the | The limited grants on this page don't give the kodi user permissions to create required TRIGGERs during install or upgrade. | ||
''' | '''{{kodi}} requires these TRIGGERs to function properly.''' | ||
Use the broader grant *.* statement that is explained on the previous tabs while creating or upgrading the tables. Only restrict rights afterwards, if you need to. | Use the broader grant *.* statement that is explained on the previous tabs while creating or upgrading the tables. Only restrict rights afterwards, if you need to. | ||
Revision as of 22:01, 10 January 2015
Share libraries w/MySQL, guide: |
MySQL | Setting up MySQL |
You'll need to choose which of your computers, XBMC devices, or NAS will be the MySQL server. The server needs to be on 24/7 or have wake-on-lan (preferably the former), and needs to have a local static IP. You will probably want the XBMC device that is hosting most or all of your videos and music to also be the MySQL server, but this is not required.
Note: XBMC v13 seems to have fixed the issue with MySQL 5.6, making it safe to use with XBMC.
Please Note: Don't create the MySQL databases on your server. Simply set up the MySQL server itself, as XBMC will create the specific databases by itself.
MySQL can be installed on just about every major OS:
Next step: | Setting up XBMC |