Criando usuário no MySql com senha hash

Para criar um usuário e definir a senha hash basta executar os comandos abaixo

mysql> select password (‘welcome’);

+——————————————-+
| password (‘welcome’)           |
+——————————————-+
| *DF216F57F1F2066124E1AA5491D995C3CB57E4C2 |
+——————————————-+
1 row in set (0.01 sec)

Agora que sabemos a hash, vamos criar o usuário

mysql>GRANT ALL PRIVILEGES ON*.* TO ‘root’@’localhost’ IDENTIFIED BY PASSWORD ‘*DF216F57F1F2066124E1AA5491D995C3CB57E4C2’ WITH GRANT OPTION;

Query OK, 0 rows affected (0.01 sec)

mysql>FLUSH PRIVILEGES;

Query OK, 0 rows affected (0.01 sec)

Leave a Reply

Your email address will not be published. Required fields are marked *