Using tables with dashes in MySQL queries

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem

You have some databases in MySQL that contain dashes in their names, and when you try to use them (ie grant access to them), you get the following error:

Solution

To be able to use them, enclose the database name in backticks (`) like: