首页 > 代码库 > 新建数据库并为其创建专用账号

新建数据库并为其创建专用账号

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 ;

flush privileges;

新建数据库并为其创建专用账号