MySQL给新建用户并赋予权限最简单的方法

(编辑:jimmy 日期: 2025/4/24 浏览:2)

创建一个用户:

create user 'oukele'@'%' identified by 'oukele'; 

 

提示下面所列出的信息的话,得刷新一下权限表

The MySQL server is running with the --skip-grant-tables option so it cannot execute this st...

步骤如下:

MySQL给新建用户并赋予权限最简单的方法

扩展学习

mysql 新建用户并赋予远程访问权限

[root@demo /]# mysql -u root -p #登录服务器数据库

Enter password:123xxx

#1.创建一个新用户 testuser 密码为 testuserpass

CREATE USER 'testuser'@'localhost' IDENTIFIED BY 'testuserpass';

#2.创建数据库testDB

create database testDB;

#3.执行命令为testuser用户添加使用testDB权限

grant all privileges on testDB.* to testuser@localhost identified by 'testuserpass';

#4.执行命令,为testuser用户添加远程访问权限

GRANT ALL PRIVILEGES ON testDB.* TO 'testuser'@'%' IDENTIFIED BY 'testuserpass' WITH GRANT OPTION;

#5.刷新权限表

flush privileges;

以上就是本次知识点的全部内容,更多相关知识点可以在下方相关文章里查找。

一句话新闻
高通与谷歌联手!首款骁龙PC优化Chrome浏览器发布
高通和谷歌日前宣布,推出首次面向搭载骁龙的Windows PC的优化版Chrome浏览器。
在对骁龙X Elite参考设计的初步测试中,全新的Chrome浏览器在Speedometer 2.1基准测试中实现了显著的性能提升。
预计在2024年年中之前,搭载骁龙X Elite计算平台的PC将面世。该浏览器的提前问世,有助于骁龙PC问世就获得满血表现。
谷歌高级副总裁Hiroshi Lockheimer表示,此次与高通的合作将有助于确保Chrome用户在当前ARM兼容的PC上获得最佳的浏览体验。