DROP DATABASE `wordpress`;
CREATE DATABASE `wordpress` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER 'xxxuser'@'localhost' IDENTIFIED BY 'xxx123';
GRANT USAGE ON * . * TO 'xxxuser'@'localhost' IDENTIFIED BY 'xxx123' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;
GRANT ALL PRIVILEGES ON `wordpress` . * TO 'xxxuser'@'localhost' WITH GRANT OPTION ;
CREATE DATABASE `wordpress` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER 'xxxuser'@'localhost' IDENTIFIED BY 'xxx123';
GRANT USAGE ON * . * TO 'xxxuser'@'localhost' IDENTIFIED BY 'xxx123' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;
GRANT ALL PRIVILEGES ON `wordpress` . * TO 'xxxuser'@'localhost' WITH GRANT OPTION ;
flush privileges;
切换数据库: use wordpress;
转载:http://blog.csdn.net/magicbreaker/article/details/32712445