MySQL Privileges Conundrum

Sharky Forums


Results 1 to 2 of 2

Thread: MySQL Privileges Conundrum

  1. #1
    Reef Shark Nephalim's Avatar
    Join Date
    Nov 2000
    Location
    Michigan
    Posts
    463

    MySQL Privileges Conundrum

    It seems every time i create a new database or mess with MySQL in any way, I have problems with the GRANT statement. ARGH! So, I formatted my development computer and installed MySQL 4 with mysqld-max-nt. I was using 3.23 with mysqld-nt before. Then, I read in my databases from my backup file and tried to run my applications only to get an error:

    Warning: mysql_connect(): Access denied for user: 'php@localhost' (Using password: YES) in C:\blog\main.php on line 5
    I tried to do a GRANT ALL ON blog.* but received an error that I had incorrectly used the GRANT command, or, if tried to make the user 'php@localhost' or 'php', it said the user was denied access. As far as I can tell, I did nothing different than before.

    !@%#&@#$@#$ This is one area of MySQL I don't like - any help?
    ~ And that is my humble opinion.

    When I was a boy I was told that anybody could become President. Now I'm beginning to believe it. - Clarence Darrow

    The greatness of a woman’s power is measured in the size and amount of the balls she clutches in hand. -Nephalim

    "Tink"
    1700+ XP on A7N8X, 768MB PC2700 DDRRAM, Samsung 19" 900IFT, Radeon 64MB DDR VIVO, SB Live! MP3+, 42.9GB IBM HDD, Plexwriter 8/4/32, 3C905CTXM NIC

    "Hermes"
    Dell Inspiron 8200, 1.7 GHz P4, 512MB DDRRAM, 30GB HDD, DVDROM, Geforce4 Go 64MB

  2. #2
    Ursus Arctos Moderatis Grizzly's Avatar
    Join Date
    Sep 2000
    Location
    Providence, RI USA
    Posts
    3,077
    So this is a new installation of MySQL? I'm assuming you've logged in as root, and are staring at a SQL prompt? I think your only problem is that you don't have the syntax quite right when trying to add the "php" user you're trying to create. The syntax should go something like this:

    Code:
    GRANT ALL PRIVILEGES ON blog.* TO php@localhost
    IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
    Good luck Neph.

Posting Permissions

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