mysql中添加一个和root一样的用户用于远程连接:
大家在拿站时应该碰到过。root用户的mysql,只可以本地连,对外拒绝连接。
下面语句添加一个新用户administrtor:
CREATE USER 'monitor'@'%' IDENTIFIED BY 'admin'; GRANT ALL PRIVILEGES ON *.* TO 'monitor'@'%' IDENTIFIED BY 'admin' WITH GRANT OPTION MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;
删除这个用户:
DROP USER 'monitor'@'%'; DROP DATABASE IF EXISTS `monitor` ;