problem with GRANT statement

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Xerxes

    #1

    problem with GRANT statement

    I am having a problem with accessing MySQL database from my PHP code.
    I tested accessing MySQL db locally and once things worked I created
    the same DB on my web hosting's server. No problem creating database
    and tables and populating it.
    My database is called "sassisc".

    However, my code dies when it tries to connect to DB:

    $result = mysql_pconnect( 'localhost', 'sassisc', 'dodge3') or
    die("Could not connect : " . mysql_error());

    I get:

    Could not connect : Access denied for user: 'sassisc@localh ost' (Using
    password: YES)

    I went to PHPMyAdmin and tried to execute the following command:

    GRANT SELECT , INSERT , UPDATE , DELETE ON sassisc.* TO
    sassisc@localho st IDENTIFIED BY 'dodge3'

    It came back with an error message:

    SQL-query :

    GRANT SELECT , INSERT , UPDATE , DELETE ON sassisc. * TO
    sassisc@localho stIDENTIFIEDBY 'dodge3'

    MySQL said:

    You have an error in your SQL syntax. Check the manual that
    corresponds to your MySQL server version for the right syntax to use
    near 'BY 'dodge3'' at line 1

    For some reason, the words "localhost" , "identified " and "by" were
    stuck to each other. I tired this a few times and every time it was
    same.
    When I execute the same command minus the IDENTIFIED BY part, it works
    fine.

    What am I doing wrong or missing?

    TIA.
Working...