MYSQL添加新用户并指定数据库

来源:互联网 发布:php 表单 编辑:程序博客网 时间:2024/06/05 19:05

       1.cd /d   windows版        cd  linux版          //切换到mysql.exe的安装位置

       2.mysql -uroot -p密码  

       3.use mysql

       4.insert into user(Host,User,Password) values('localhost','新用户',password('密码'));

       5.flush privileges;

       6.grant all privileges on 数据库名.* to 新用户@localhost identified by '密码';

     7.flush privileges;

1 0
原创粉丝点击