SQL: Create a user that has only access to one database


/ Published in: SQL
Save to your folder(s)

creates a user that has only access to one database, from any host


Copy this code and paste it in your HTML
  1. CREATE USER 'username'@'%' IDENTIFIED BY 'password';
  2. GRANT ALL PRIVILEGES ON `database` . * TO 'username'@'%';
  3. FLUSH PRIVILEGES;

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.