First, Login to MySQL as an administrator account with:
You will be prompted for your root password before being granted access to the MySQL
Now to check available user accounts on the system. type this command:
If the user account that you wish to create doesn’t appear in that list
To create a new user account type this command:
this user isn’t linked to any databases yet, but this is simple to rectify with a:
that will grant all rights for the user account to everything held in the mydatabase database.
mysql -u root -p
You will be prompted for your root password before being granted access to the MySQL
Now to check available user accounts on the system. type this command:
SELECT USER,host FROM mysql.USER;
If the user account that you wish to create doesn’t appear in that list
To create a new user account type this command:
CREATE USER 'new-username'@'localhost' IDENTIFIED BY 'password-for-new-account';
this user isn’t linked to any databases yet, but this is simple to rectify with a:
GRANT ALL ON mydatabase.* TO useraccount@localhost
that will grant all rights for the user account to everything held in the mydatabase database.
No comments:
Post a Comment