Grant Privileges with MySql

Posted on the 13 May 2014 by Akahgy

Description:

Grant privileges on a number of databases containing the same prefix.

Solution:

The tricky part is to take care of the right quotes to use, in particular the backtick ( ` )

Syntax is then as follows:

GRANT ALL ON `wordpress_%`.* TO ‘user’@’localhost’ IDENTIFIED BY ‘longasspassword’;

ALL can be, of course whichever required from SELECT DELETE INSERT….. .

Also use a strong password generator, like http://strongpasswordgenerator.com/ is much better then anything you could come up with.