MySQL
Creating a Database User
For MySQL 8+, create a user using the old password plugin:
CREATE USER 'user'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
GRANT ALL PRIVILEGES ON database.* TO 'user'@'localhost';
For older MySQL versions and MariaDB (on Linux), create the user:
CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON database.* TO 'user'@'localhost';
Last updated
Was this helpful?