Home > Database > Mysql Tutorial > 【一个小坑】Mysql用户、权限和密码。(创建的用户无法登入)_MySQL

【一个小坑】Mysql用户、权限和密码。(创建的用户无法登入)_MySQL

WBOY
Release: 2016-06-01 13:02:20
Original
1084 people have browsed it

Mysql Version: Mysql 5.6.

Mysql 中 用户的权限,不仅跟用户相关,还和用户的登入密码(口令)相关。

比如以下语句:

创建用户

create user 'name'@'localhost' identified by 'password'.

授权:

grant all on database.* to username.

这样的语句,你用name + password登入Mysql 会被拒绝。

应该养成好的习惯。

grant all on database.* to username identified by 'password'.

总结下:

在Mysql中,用户+密码不是唯一标识,用户+密码+权限 才是唯一标识,这三者的任意组合,对于user数据库来说都是一条不同的记录。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template