This is definitely an edge case that I can account for in my StackScripts before calling mysql_create_database from the Bash Library provided by Linode, but I thought I'd pass the info along in case you wanted to run the same code or add comments to the function.
MySQL has some wierd naming rules when it comes to database names - one that seems to bite everyone is that it can't contain a dash. I have a UDF in my script that prompts the user for a db name. While I can add comments to steer them in the right direction, I can't do any form validation, so the next best thing is to run the UDF through 'tr' before handing it off to mysql_create_database, like so:
Code:
DB_NAME=$(echo ${DB_NAME} | tr '[:cntrl:][:punct:][:space:]' '_')
I know changing user data can be bad, but usually creating a db is the first step in a chain of events that will fail miserably if the db creation fails, so IMHO it's a necessary evil.
If you deem this as not a bug but a "tip", feel free to move this post to the proper forum.