您好,欢迎来到二三娱乐。
搜索
您的当前位置:首页怎么给mysql添加用户名和密码

怎么给mysql添加用户名和密码

来源:二三娱乐

具体方法:

(推荐教程:)

1、打开命令提示符,进入到 mysql 的安装目录下

2、使用root用户登录数据库

E:\mysql-5.6.14-winx64\bin>mysql -uroot -p

3、创建用户

create user'用户名'@'localhost'identified by '密码';

4、给予权限  GRANT ALL ON *.* TO 'rsm'@'%';

grant all on *.* to 'jsyl'@'localhost';
grant all privileges on *.* to 'root'@'%' identified by 'root'; (%) 表示所有ip

执行完上述命令后用下面的命令刷新权限

flush privileges;

5、退出,检验,新用户重新登录

E:\mysql-5.6.14-winx64\bin>mysql -ujsyl -p            
Enter password: *********                
Welcome to the MySQL monitor.  
Commands end with ; or \g.                
Your MySQL connection id is 36

Copyright © 2019- yule263.com 版权所有 湘ICP备2023023988号-1

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务