Last active
November 18, 2017 22:31
-
-
Save aristidesneto/6445991d45affa1f176654292307722c to your computer and use it in GitHub Desktop.
Criação de banco de dados e usuário MariaDB/MySql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Criar database | |
CREATE DATABASE name_database CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | |
## Criar usuario | |
CREATE USER 'userbd'@'localhost' IDENTIFIED BY 'password'; | |
## Adicionando privelegios | |
GRANT ALL PRIVILEGES ON name_database.* TO 'userbd'@'localhost'; | |
## Listar usuários criados e seus respectivos bancos | |
select u.User,Db from mysql.user u,mysql.db d where u.User=d.User; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment