Create new user and grant all privileges on a schema
suggest changeCREATE USER 'new_user_name'@'%' IDENTIFIED BY 'newpassword';
GRANT ALL PRIVILEGES ON schema_name.* TO 'new_user_name'@'%';
In MySQL, a schema is a database. This grants every privilege on that one database, not global privileges, so it does not create another root account. GRANT ... IDENTIFIED BY was removed in MySQL 8.0; create the user first. Before 8.0, that GRANT created the account only when NO_AUTO_CREATE_USER was not in sql_mode.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents