MySQL给新建用户并赋予权限最简易的方法
发布时间:2022-03-17 00:39:53 所属栏目:MySql教程 来源:互联网
导读:创建一个用户: create user oukele@% identified by oukele; 提示下面所列出的信息的话,得刷新一下权限表 The MySQL server is running with the --skip-grant-tables option so it cannot execute this st... 步骤如下: 扩展学习 mysql 新建用户并赋予远
创建一个用户: create user 'oukele'@'%' identified by 'oukele'; 提示下面所列出的信息的话,得刷新一下权限表 The MySQL server is running with the --skip-grant-tables option so it cannot execute this st... 步骤如下: 扩展学习 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; 以上就是本次知识点的全部内容,更多相关知识点可以在下方相关文章里查找。 (编辑:晋中站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |