Problem: MySQL cannot create db
|
26th Jan, 2014, 01:40 AM
Post: #1
|
|||
|
|||
MySQL cannot create db
Hi, i created xbmc user on my mysql server and gave grants to it, but i get these errors:
Code: 16:02:20 T:3041141280 ERROR: Unable to open database: MyMusic32 [1045](Access denied for user 'xbmc'@'xbian.local' (using password: YES)) So i cannot create databases. MySql server bind on 0.0.0.0. I can connect from xbian with mysql command line and create databases with same user and password. This is my advanceconfig: Code: <advancedsettings> So, why i get that errors? |
|||
26th Jan, 2014, 02:24 AM
Post: #2
|
|||
|
|||
RE: MySQL cannot create db
by default MySQL granting system works by giving / revoking access to existing DBs, tables, or whatever.
role to create NEW db is not there by default. double check that. I started with creating mysqld package few weeks ago and there was no technical problem. btw: still while you don't have databases, do a "chattr +C /var/lib/mysql". this will set NoCOW operations on new file within this directory (otherwise btrfs would be quite slow there). Please read rules and do a search before you post! . FAQs . How to post log file? . Looking for answers? Please start here |
|||
26th Jan, 2014, 02:30 AM
Post: #3
|
|||
|
|||
RE: MySQL cannot create db
(26th Jan, 2014 02:24 AM)mk01 Wrote: by default MySQL granting system works by giving / revoking access to existing DBs, tables, or whatever. So, i read that xbmc create db itself. If i connect with mysql -uxbmc -h192.168.0.110 -p then i can create db, but xbian cannot. What should i do? |
|||
26th Jan, 2014, 02:51 AM
Post: #4
|
|||
|
|||
RE: MySQL cannot create db
unfortunately XBMC will try to create NEW DB with upgrades if structure changes. that leads to concern, that you have to give CREATE privilege but can be partially mitigated by telling XBMC to always name the DB with prefix (or instance 'xbmc_') and then you give full including create just to 'xbmc_%'
like this: INSERT INTO `db` (`Host`, `Db`, `User`, `Select_priv`, `Insert_priv`, `Update_priv`, `Delete_priv`, `Create_priv`, `Drop_priv`, `Grant_priv`, `References_priv`, `Index_priv`, `Alter_priv`, `Create_tmp_table_priv`, `Lock_tables_priv`, `Create_view_priv`, `Show_view_priv`,`Create_routine_priv`, `Alter_routine_priv`, `Execute_priv`, `Event_priv`, `Trigger_priv`) VALUES ('%','xbmc_%','xbmc','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'); second row is dbname, third what you see as 'xbmc' is user name. so in you case 'xbmc' ))) prefix is defined in db definitions in advancedsettings, like pass or user : <name>xbmc_MyVideos</name> => Code: <videodatabase> in that case xbmc will always alter only number and lla version will have name xbmc_MyVideos or Music. Please read rules and do a search before you post! . FAQs . How to post log file? . Looking for answers? Please start here |
|||
26th Jan, 2014, 04:29 AM
Post: #5
|
|||
|
|||
RE: MySQL cannot create db
Uhm, but mine is a new installation, so I don't have any db to upgrade.
I read XBMC guide to setup mysql and this issue is not explained. Anyway, I don't think I got your explanation..How can I force XBMC to create new databases? Can I create that databases manually? |
|||
26th Jan, 2014, 05:20 AM
Post: #6
|
|||
|
|||
RE: MySQL cannot create db
doiesn't matter if you have or not.
in both cases xbmc wants to create new. yes, you can create empty database (if you know the version for your current xbmc - because version number is in the name). but you hit the same problem when xbmc will updating db structure. later. xbmc is ALWAYS in that case creating new first. Please read rules and do a search before you post! . FAQs . How to post log file? . Looking for answers? Please start here |
|||
26th Jan, 2014, 06:04 AM
Post: #7
|
|||
|
|||
RE: MySQL cannot create db
Ok, so my solution is not good.
Can you re-explain me why it cannot create the new db? Permission problems? |
|||
26th Jan, 2014, 12:59 PM
Post: #8
|
|||
|
|||
RE: MySQL cannot create db
yes. because mysql works by default by GRANTING privileges on object. not global.
try: Code: GRANT ALL ON *.* TO xbmc@%; Please read rules and do a search before you post! . FAQs . How to post log file? . Looking for answers? Please start here |
|||
26th Jan, 2014, 08:50 PM
Post: #9
|
|||
|
|||
RE: MySQL cannot create db
Same error: Unable to open database myvideos# or unable to create database.
I also did a flush privileges. |
|||
28th Jan, 2014, 06:31 AM
Post: #10
|
|||
|
|||
RE: MySQL cannot create db
Suggestions? I'm stuck
|
|||
28th Jan, 2014, 06:44 AM
Post: #11
|
|||
|
|||
RE: MySQL cannot create db
Here is how I did it, maybe it helps.
Code: CREATE USER 'xbmc' IDENTIFIED BY 'xbmc'; The last two only work on newer MySQL version >= 5.5 IIRC. Older ones need GRANT SUPER ON ... Also read following about the <name> tag, mabe you have an issue with that one. http://wiki.xbmc.org/index.php?title=HOW-TO:Share_libraries_using_MySQL/Setting_up_XBMC#Name_tag |
|||
28th Jan, 2014, 06:53 AM
Post: #12
|
|||
|
|||
R: RE: MySQL cannot create db
(28th Jan, 2014 06:44 AM)teekay Wrote: Here is how I did it, maybe it helps. First 3 lines are the same of mine. I try others, i have mysql 5.5. I didn't set the name tag... |
|||
1st Feb, 2014, 09:10 PM
Post: #13
|
|||
|
|||
RE: MySQL cannot create db
Same error, XBMC cannot create databases.
Should i try with root user? |
|||
2nd Feb, 2014, 08:03 PM
Post: #14
|
|||
|
|||
RE: MySQL cannot create db
Any help?
Done. It was a really stupid error: Tag <password> instead tag <pass>. Thank you |
|||
« Next Oldest | Next Newest »
|