#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    109
    Rep Power
    15
    How can i make that a DB-User can only access one Database on my MySql and don't have the permission to access all the Databases!

    Thanx!
  2. #2
  3. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    19
    grant all on dbname.* to username@localhost identified by 'password';
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    109
    Rep Power
    15
    But if i stop and restart the Mysql-Deamon i must redo this command or it would be done automatically??

    It's a great day - today.
  6. #4
  7. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    19
    GRANT automatically updates the permission tables and flushes privileges so it takes effect immediately. These privilege tables are read when the deamon starts, so no, you don't have to redo them.
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    27
    Rep Power
    0
    why does eveyone restart mysqld ??
    i always adjust privileges and it just works immediately ?!?!
    no restart needed
  10. #6
  11. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    19
    wouterr,

    The reason is that before GRANT, you had to manipulate the privilege tables directly. You could do a FLUSH PRIVILEGES to force mysql to re-read them so the new privileges would take affect, but many people would restart the daemon instead.

    GRANT does away with all that as it flushes automatically after updating the tables.

    I really don't know why some people still insist on updating the tables directly themselves. GRANT is much easier to use and safer.

Similar Threads

  1. Need advice designing a usage tracking database (MySQL)
    By Randolpho in forum Database Management
    Replies: 0
    Last Post: February 13th, 2004, 04:11 PM
  2. Newbie needing help sending data to mysql database
    By blackface in forum PHP Development
    Replies: 3
    Last Post: February 13th, 2004, 12:26 AM
  3. Replies: 3
    Last Post: February 11th, 2004, 08:30 AM
  4. MYSQL database
    By isheikh in forum MySQL Help
    Replies: 3
    Last Post: January 14th, 2004, 10:58 PM
  5. Writing Japanese unicode text to a mysql database
    By jayhay in forum PHP Development
    Replies: 3
    Last Post: January 13th, 2004, 08:10 AM

IMN logo majestic logo threadwatch logo seochat tools logo