Skip to content

Instantly share code, notes, and snippets.

@aristidesneto
Last active November 18, 2017 22:31
Show Gist options
  • Save aristidesneto/6445991d45affa1f176654292307722c to your computer and use it in GitHub Desktop.
Save aristidesneto/6445991d45affa1f176654292307722c to your computer and use it in GitHub Desktop.
Criação de banco de dados e usuário MariaDB/MySql
## 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