SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: MySQL Question

  1. #1
    SitePoint Member
    Join Date
    Dec 2000
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi, I'm using MySQL on Windows 98.

    On my comp, I have a root account set-up, but I am trying to set up:

    A New Database (I Know how to do this)
    A New User and Pass that can only access that database, not the mysql database and other databases.

    Does anyone know how I can do this?

    Any help greatly appreciated,

    Nick

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    mysql> GRANT ALL PRIVILEGES ON newdatabasename.* to newusername@localhost IDENTIFIED by 'userspassword';

    mysql>FLUSH PRIVILEGES;
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  3. #3
    SitePoint Member
    Join Date
    Dec 2000
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the reply, but wouldn't

    mysql> GRANT ALL PRIVILEGES ON newdatabasename.* to newusername@localhost IDENTIFIED by 'userspassword';

    give the new user access to the other databases? GRANT ALL PRIVILEGES?

  4. #4
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    NO that is why you put the ON databasename.* that means all privileges on all the tables in a specified database if you said
    GRANT ALL PRIVILEGES ON *.* to newusername@localhost IDENTIFIED by 'userspassword';

    Yes you would be giving the full access to all databases
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  5. #5
    SitePoint Member
    Join Date
    Dec 2000
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, it works great!

    i Just have a question. Hosts like this:

    http://www.datablocks.net/phpMyAdmin
    http://www.freedom2surf.net/db

    have this login feature. Does anyone know how I can do this?

    Thanks,

    Nick

  6. #6
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I imagine you can use the $PHP_AUTH_USER and $PHP_AUTH_PASSWORD in the phpMyAdmin config file iwhere you specify the username and password then one would put their username and password in and it would give them access to the dbs they have rights on
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  7. #7
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    For a good overview of MySQL access management, see Part 8 of my article, "Building a Database Driven Web Site Using PHP and MySQL".
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Babys got backa hard back, that is: The Ultimate CSS Reference


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •