User account can be created by using MySQL's
GRANT statement. For this, you'll need to login to MySQL using the
root account, which has full privilege on the
The following statement will create a user account named
myusername which will have full access to the
mydatabase database from
localhost and set the password to
GRANT ALL ON mydatabase.* TO 'myusername'@'localhost' IDENTIFIED BY 'mypassword';
Sign up for The Ultimate MySQL Bootcamp: Go from SQL Beginner to Expert and many other great courses on Udemy to learn more.
Become an In-demand SQL Master by creating complex databases and building reports through real-world projects!
Written by Mohd Shakir Zakaria.
Last updated on 2019-02-12.