Login in as an administrator to SQL CLI interface
mysql -u root -p
Now create a database where the user will belong to
CREATE DATABASE TheDatabase;
Now let’s go ahead and create a user
CREATE USER TheUser;
Next will be to give permission to the user for the selected database along with password, note this user will be able to drop tables, create table etc without no restrictions.
GRANT ALL ON TheDatabase.* TO 'TheUser'@'localhost' IDENTIFIED BY 'Th3passw0rd';
Don’t forget to flush the privileges or else your application might complain!
I always had a passion for the field of STEM (Science, Technology, Engineering, and Math) and I knew I wanted to do something to make a difference in the world. I just didn’t know where to start. I was an immigrant in a new country, grew up in a tough environment, and wasn’t sure how… Read More