Create new user and grant all privileges on a schema

suggest change
CREATE 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.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents