mysql database hyphen 1

mysql database hyphen

Put database names with hyphen characters (-) in backticks (``) to execute querries.

Example: 
GRANT ALL PRIVILEGES ON `database-name`.* TO 'username'@'localhost';

Here is what the above code is Doing:
1. Create a database called ‘database-name’
2. Create a user called ‘username’ with password ‘password’
3. Grant all privileges to the user on the database
4. Flush privileges to make sure the changes take effect

Similar Posts