Ok, Im Able to create and drop databases,
but does anyone know the commands to assign users, and set the permissions for them
3 replies to this topic
#1
Posted 18 March 2011 - 03:08 PM
|
|
|
#2
Posted 20 March 2011 - 11:43 AM
The syntax for creating users in MySQL is:
Replace the lowercase words above with your info. For example, if I were creating myself, I would use:
The syntax for granting permissions is such:
So, again, if I were granting SELECT, INSERT, and UPDATE permissions to myself on all tables stored in the 'myinventory' database, it would look like this:
Hope that helps. Check the MySQL documentation on their website for the full, unabridged syntax of these statements.
CREATE USER 'username'@'host' IDENTIFIED BY 'password';
Replace the lowercase words above with your info. For example, if I were creating myself, I would use:
CREATE USER 'greg'@'localhost' IDENTIFIED BY 'someweakpassword';
The syntax for granting permissions is such:
GRANT priv [,priv, ...] ON dbname.tablename TO 'username'@'host' IDENTIFIED BY 'password';
So, again, if I were granting SELECT, INSERT, and UPDATE permissions to myself on all tables stored in the 'myinventory' database, it would look like this:
GRANT SELECT, INSERT, UPDATE ON myinventory.* TO 'greg'@'localhost' IDENTIFIED BY 'someweakpassword';
Hope that helps. Check the MySQL documentation on their website for the full, unabridged syntax of these statements.
#3
Posted 20 March 2011 - 12:12 PM
thank you
#4
Posted 20 March 2011 - 12:22 PM
My pleasure.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









