Firstly, you must log in as root.
mysql -u root -p
Now you can create a new user. Replace your_username
and password
with your own.
CREATE USER 'your_username'@'localhost' IDENTIFIED BY 'password';
Now you can grant privileges. Replace your_dbname
, your_username
and your_password
with your own details.
GRANT ALL PRIVILEGES ON your_dbname.* To 'your_username'@'localhost' IDENTIFIED BY 'your_password';
Once you have finalised the permissions that you want to set up for your new users, always be sure to reload all the privileges.
FLUSH PRIVILEGES;
Let me know if this helped. Follow me on Twitter, Facebook and YouTube, or 🍊 buy me a smoothie.