MySQL(Linux)用户管理之总结
敬业的IT人
互联网
佚名
2008-1-7 14:00:58
用root登录(仅限本地)[root@np3 bin]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 344 to server version: 4.1.10a-standardType 'help;' or 'h' for help. Type 'c' to clear the buffer.mysql> 增加或修改用户权限---本地 mysql> GRANT all on *.* to globus@'localhost' identified by "123456";增加或修改用户权限---远程 mysql> GRANT all on *.* to globus@'%' identified by "123456";关键是此句中的%号要加' ',否则说语法错误,这是4.1.1的新规则。害的我到www.mysql.com上找了文档看了一下。下面是官方的文档shell> mysql --user=root mysqlIf you have assigned a password to the root account, you'll also need to supply a --password or -p option for this mysql command and also for those later in this section. After connecting to the server as root, you can add new accounts. The following statements use GRANT to set up four new accounts: mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost' -> IDENTIFIED BY 'some_pass' WITH GRANT OPTION;mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'%' -> IDENTIFIED BY 'some_pass' WITH GRANT OPTION;mysql> GRANT RELOAD,PROCESS ON *.* TO 'admin'@'localhost';mysql> GRANT USAGE ON *.* TO 'dummy'@'localhost';
Enter password:
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 344 to server version: 4.1.10a-standardType 'help;' or 'h' for help. Type 'c' to clear the buffer.mysql> 增加或修改用户权限---本地 mysql> GRANT all on *.* to globus@'localhost' identified by "123456";增加或修改用户权限---远程 mysql> GRANT all on *.* to globus@'%' identified by "123456";关键是此句中的%号要加' ',否则说语法错误,这是4.1.1的新规则。害的我到www.mysql.com上找了文档看了一下。下面是官方的文档shell> mysql --user=root mysqlIf you have assigned a password to the root account, you'll also need to supply a --password or -p option for this mysql command and also for those later in this section. After connecting to the server as root, you can add new accounts. The following statements use GRANT to set up four new accounts: mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost' -> IDENTIFIED BY 'some_pass' WITH GRANT OPTION;mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'%' -> IDENTIFIED BY 'some_pass' WITH GRANT OPTION;mysql> GRANT RELOAD,PROCESS ON *.* TO 'admin'@'localhost';mysql> GRANT USAGE ON *.* TO 'dummy'@'localhost';
- 最新文章
- MySQL安全问题(匿名用户)的一点心得[01-07]
- MySQL不安全临时文件建立漏洞[01-07]
- 最简便的备份MySql数据库方法[01-07]
- MySQL优化全攻略-相关数据库命令[01-07]
- MySQL优化全攻略-服务器参数调整[01-07]
- MySQL丢了root密码怎么办?[01-07]
- 相关文章
- MySQL安全问题(匿名用户)的一点心得[01-07]
- MySQL不安全临时文件建立漏洞[01-07]
- 最简便的备份MySql数据库方法[01-07]
- MySQL优化全攻略-相关数据库命令[01-07]
- MySQL优化全攻略-服务器参数调整[01-07]
- MySQL丢了root密码怎么办?[01-07]
