登录root账户创建普通账户并给普通账户授权:(1)创建一个密码为“123456”的普通用户账户“databasenormal',(2分):create user' databasenormal'@’localhost' identified by' 123456’;(2)创建名为student的数据库;(2分)create database student,(3)创建名为student2的表,包括stuno(学号列)、stubir(生日列)、age(年龄列),并设置主键为stuno;(8分)create table student2(stuno char(50),stubir char(4),age int,PRIMRY KEY stuno);(4)使用grant命令对其进行student数据库的student2的表的stuno列的select操作授权;(2分)grant select(stuno) on student。 student2 to databasenormal@localhost;(5)查看mysql数据库下user表中该用户的条目;(2分)select*from user where User-’databasenormal’\G(6)查看mysql数据库下table_priv表中该用户条目;(2分)select*from tables_priv where User=’databasenormal’;(7)查看mysql数据库下cotumns_priv表中该用户条目;(2分)select* from columns_priv where User=’databasenormal’;
小编还为您整理了以下内容,可能对您也有帮助:
vm虚拟机中如何在/home目录下创建ABC目录,创建abc普通用户,密码设置为123456?
在root权限下,使用useradd -m abc命令,创建abc普通用户,并在/home目录下创建abc目录;使用passwd abc命令设置abc用户的密码,要输两遍密码123456。下载本文