# 创建用户 Joe 要给数据组的 John 创建一个用户,他希望John 能够从 `192.168.7.42` 登录 goods 数据库查询数据, 用户第一次登录时使用密码 `goods123`,登录后必须设定一个新密码,那么应该用哪个语句? ## 答案 ```mysql create user 'john'@'192.168.7.42' identified by 'goods123' password expire; grant select on goods.* to 'john'@'192.168.7.42'; flush privileges; ``` ## 选项 ### A ```mysql create user 'john'@'192.168.7.42' identified by 'goods123'; grant select on goods.* to 'john'@'192.168.7.42'; flush privileges; ``` ### B ```mysql create user 'john'@'192.168.7.42' identified by 'goods123'; grant usage on goods.* to 'john'@'192.168.7.42'; flush privileges; ``` ### C ```mysql create user 'john'@'192.168.7.42' identified by 'goods123' on database goods; flush privileges; ```