Skip to content

Instantly share code, notes, and snippets.

@Hazem-Ben-Khalfallah
Last active July 8, 2019 11:08
Show Gist options
  • Save Hazem-Ben-Khalfallah/a5fbbc7d10e90373ad99ddf26f5984d6 to your computer and use it in GitHub Desktop.
Save Hazem-Ben-Khalfallah/a5fbbc7d10e90373ad99ddf26f5984d6 to your computer and use it in GitHub Desktop.
[DB schema and privileges] #sql #mysql
#connect to mysql
mysql -u root -p
#list privileges
select user,host from mysql.user;
# create new schema
CREATE SCHEMA `[SCHEMA_NAME]` DEFAULT CHARACTER SET utf8;
# grant acess on schema to user
GRANT ALL ON `[SCHEMA_NAME]`.* TO '[DB_USER]'@'%';
flush privileges;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment