mysql新建的用户有什么权限

这篇文章运用简单易懂的例子给大家介绍mysql新建的用户有什么权限,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。

mysql新建的用户怎么设置权限

1.进入MySQL

    mysql -u root -p

2.创建新用户

创建用户名为testuser,密码为123456

    grant all privileges on *.* to testuser@localhost identified by "123456"

设置用户testuser,可以在本地访问mysql

    grant all privileges on *.* to testuser@localhost identified by "123456"l

设置用户testuser,可以在远程访问mysql

    grant all privileges on *.* to testuser@"%" identified by "123456"

3.设置用户数据库权限

设置用户只能访问数据库test_db

    grant all privileges on test_db.* to testuser@localhost identified by "123456"

设置用户可以访问mysql上的所有数据库

     grant all privileges on *.* to testuser@localhost identified by "123456"

3.设置用户操作权限

设置用户管理员权限

    grant all privileges on *.* to testuser@localhost identified by "123456" WITH GRANT OPTION ;

设置用户只有查询操作权限

    grant select on *.* to testuser@localhost identified by "123456" WITH GRANT OPTION ;

MySQL是一个关系型数据库管理系统,由瑞典MySQL AB 公司开发,属于 Oracle 旗下产品。MySQL 是最流行的关系型数据库管理系统之一,在 WEB 应用方面,MySQL是最好的 RDBMS (Relational Database Management System,关系数据库管理系统) 应用软件之一。MySQL是一种关系型数据库管理系统,关系数据库将数据保存在不同的表中,而不是将所有数据放在一个大仓库内,这样就增加了速度并提高了灵活性 。

关于mysql新建的用户有什么权限就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。