为Mysql添加用户名和密码
1,用户root用户登陆
-
D:\Program Files\MySQL\MySQL Server 5.0\bin>mysql -h127.0.0.1 -uroot -p123456
-
Welcome to the MySQL monitor. Commands end with ; or \g.
-
Your MySQL connection id is 10
-
Server version: 5.0.41-community-nt MySQL Community Edition (GPL)
-
-
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
-
-
mysql>
2,添加一个本地用户,名为username密码为password
-
GRANT ALL PRIVILEGES ON *.* TO username@localhost IDENTIFIED BY 'password' WITH GRANT OPTION;
3,添加一个远程用户,名为mindworks密码为mindworks
-
GRANT ALL PRIVILEGES ON *.* TO mindworks@"%" IDENTIFIED BY 'mindworks' WITH GRANT OPTION;
4,添加完用户后要刷新Mysql服务。
阅读(1803) | 评论(0) | 转发(0) |