Jump to content

LibMysql.dll Help Needed

- - - - -

  • Please log in to reply
3 replies to this topic

#1
Ewe Loon

Ewe Loon

    Learning Programmer

  • Members
  • PipPipPip
  • 49 posts
Ok, Im Able to create and drop databases,
but does anyone know the commands to assign users, and set the permissions for them

#2
gregwarner

gregwarner

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 853 posts
  • Location:Arkansas
The syntax for creating users in MySQL is:


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
Ewe Loon

Ewe Loon

    Learning Programmer

  • Members
  • PipPipPip
  • 49 posts
thank you

#4
gregwarner

gregwarner

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 853 posts
  • Location:Arkansas
My pleasure.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users