Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Web Design & Development Web Design & Development
Search Search
Search for:
Tech Support Guy > > >

Solved: Creating a localhost user in phpMyAdmin


(!)

JiminSA's Avatar
JiminSA   (Jim) JiminSA is offline JiminSA has a Profile Picture
Computer Specs
Member with 1,551 posts.
THREAD STARTER
 
Join Date: Dec 2011
Location: Johannesburg South Africa
Experience: Intermediate
17-Jul-2012, 04:46 AM #1
Solved: Creating a localhost user in phpMyAdmin
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 Code:
$con mysql_connect("localhost","surfwhee_jim","******james******") or die(mysql_error()); 
it gives me the following error response...
Quote:
Access denied for user 'surfwhee_jim'@'localhost' to database 'surfwhee_vehicles'
can anyone see where I might be screwing up?
(The passwords have been edited out - but are identical)
Attached Thumbnails
Solved: Creating a localhost user in phpMyAdmin-ss1.png  
dukevyner's Avatar
dukevyner   (Luke) dukevyner is offline
Computer Specs
Member with 787 posts.
 
Join Date: Nov 2011
Location: Pakenham, VIC, Australia
Experience: Advanced
17-Jul-2012, 05:50 AM #2
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..
JiminSA's Avatar
JiminSA   (Jim) JiminSA is offline JiminSA has a Profile Picture
Computer Specs
Member with 1,551 posts.
THREAD STARTER
 
Join Date: Dec 2011
Location: Johannesburg South Africa
Experience: Intermediate
17-Jul-2012, 06:12 AM #3
Thanks - does that mean the SQL query needs expanding to include the permissions for the user?
dukevyner's Avatar
dukevyner   (Luke) dukevyner is offline
Computer Specs
Member with 787 posts.
 
Join Date: Nov 2011
Location: Pakenham, VIC, Australia
Experience: Advanced
17-Jul-2012, 06:42 AM #4
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
JiminSA's Avatar
JiminSA   (Jim) JiminSA is offline JiminSA has a Profile Picture
Computer Specs
Member with 1,551 posts.
THREAD STARTER
 
Join Date: Dec 2011
Location: Johannesburg South Africa
Experience: Intermediate
17-Jul-2012, 07:30 AM #5
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
dukevyner's Avatar
dukevyner   (Luke) dukevyner is offline
Computer Specs
Member with 787 posts.
 
Join Date: Nov 2011
Location: Pakenham, VIC, Australia
Experience: Advanced
17-Jul-2012, 08:15 AM #6
Good to hear... Remember there's always someone online here don't hesitate to ask for help
JiminSA's Avatar
JiminSA   (Jim) JiminSA is offline JiminSA has a Profile Picture
Computer Specs
Member with 1,551 posts.
THREAD STARTER
 
Join Date: Dec 2011
Location: Johannesburg South Africa
Experience: Intermediate
17-Jul-2012, 09:08 AM #7
footnote...
Oh I'm definitely not shy when it comes to asking! (Check my signature...)
dukevyner's Avatar
dukevyner   (Luke) dukevyner is offline
Computer Specs
Member with 787 posts.
 
Join Date: Nov 2011
Location: Pakenham, VIC, Australia
Experience: Advanced
17-Jul-2012, 09:23 AM #8
That's good "The only bad question is the one not asked"
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
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.


(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑