1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Creating a localhost user in phpMyAdmin

Discussion in 'Web Design & Development' started by JiminSA, Jul 17, 2012.

Thread Status:
Not open for further replies.
Advertisement
  1. JiminSA

    JiminSA Thread Starter

    Joined:
    Dec 15, 2011
    Messages:
    2,058
    I have imported a database I set up on my website using the host's 3rd party PMA (phpMyAdmin) software. I created a user for that website database using the Control Panel. I now want to simulate the same for localhost, so I used localhost (xampp) PMA to run an sql query...
    Code:
    CREATE USER 'surfwhee_jim'@'localhost' IDENTIFIED BY *****'james*****'
    there is a screen shot of the query attached.
    All seems well, however when I attempt to gain access thus...
    PHP:
    $con mysql_connect("localhost","surfwhee_jim","******james******") or die(mysql_error());
    it gives me the following error response...
    can anyone see where I might be screwing up?:mad:
    (The passwords have been edited out - but are identical)
     

    Attached Files:

    • SS1.png
      SS1.png
      File size:
      13.5 KB
      Views:
      24
  2. dukevyner

    dukevyner

    Joined:
    Nov 4, 2011
    Messages:
    787
    The user has to be given permission to select, and if needed update, insert as well as others depending on what the user should be able to do..
     
  3. JiminSA

    JiminSA Thread Starter

    Joined:
    Dec 15, 2011
    Messages:
    2,058
    Thanks - does that mean the SQL query needs expanding to include the permissions for the user?
     
  4. dukevyner

    dukevyner

    Joined:
    Nov 4, 2011
    Messages:
    787
    The permissions have to be set on the database... I'm unsure how to set permissions with mysql in ur situation... I would look into it... But someone here may be able to cleify
     
  5. JiminSA

    JiminSA Thread Starter

    Joined:
    Dec 15, 2011
    Messages:
    2,058
    Thank you duke!
    I managed to set the permissions using the following generic
    Code:
    GRANT ALL ON mydb.* TO 'someuser'@'somehost';
    which I adapted for my set up... found it here
    and "ran" it using the SQL tab in PMA... Problem solved:D
     
  6. dukevyner

    dukevyner

    Joined:
    Nov 4, 2011
    Messages:
    787
    Good to hear... Remember there's always someone online here don't hesitate to ask for help
     
  7. JiminSA

    JiminSA Thread Starter

    Joined:
    Dec 15, 2011
    Messages:
    2,058
    Oh I'm definitely not shy when it comes to asking! (Check my signature...);)
     
  8. dukevyner

    dukevyner

    Joined:
    Nov 4, 2011
    Messages:
    787
    That's good "The only bad question is the one not asked"
     
  9. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1061383