用于创建用户的MySQL命令

时间:2018-02-20 08:42:08

标签: mysql database

如何在MySQL中实现以下功能?

键入创建名为 <div class="form-group"> <label>Status</label> <select style="width: 200px" class="form-control" id="status" name="status" required> <option value="0" >Please Select</option> <option value="ACTIVE" @php($igcse->status == 'ACTIVE') ? echo 'selected' : "" @endphp>ACTIVE</option> <option value="WITHDRAW" @php($igcse->status == 'WITHDRAW') ? echo 'selected' : "" @endphp>WITHDRAW</option> <option value="GRADUATE" @php($igcse->status == 'GRADUATE') ? echo 'selected' : "" @endphp>GRADUATE</option> </select> </div> 的用户所需的命令。用户应具有密码myuser,并且不应允许mypass从任何设备访问数据库。

1 个答案:

答案 0 :(得分:2)

使用它在mysql命令行中创建一个新用户:

CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';

所以对你:

CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'mypass';

撤销许可:

REVOKE ALL PRIVILEGES ON *.* FROM '<user_name>'@'localhost';