Skip to content

Mysql Docs

Create an user for single schema

sql
@username = "root"
@password = "123456"
@schema = "test_db"


CREATE USER '@username'@'%' IDENTIFIED BY '@password';
GRANT ALL PRIVILEGES ON @schema.* TO '@username'@'%';
FLUSH PRIVILEGES;