I have a php script that (in theory) connects to a database. The issue is that when I try to test my script in http://phptester.net/ it tells me that said credentials are wrong.
I am fairly new to this whole php and mysql set up but this is what I know thus far:
- I have a domain registered @ godaddy.com with hosting (obviously)
- I used their Database Interface to create my first database (I called it myProfile)
- I also used their interface to create a user and added that user to the database with all its privileges
Here is where the issue lays:
I go to Databases link in my cPanel page and see my database WITH my user and you can see its privileges:
Now, I go to phpMyAdmin in godaddy and I find that there is indeed the myProfile database but I can’t find the user I created.
I see a user that I never ever seen before but no matter what I do in phpMyAdmin I can’t ADD, CREATE, GRANT PRIVILEGES or do anything user related. I even tried looking up in a query to see if the one I created on the interface shows up. But nothing works!
Can anyone help me with this conundrum?
2
Answers
Your host likely doesn’t accept incoming connections from anywhere but 127.0.0.1. Even if it does, it shouldn’t accept those requests unless they’re encrypted.
Therefore, PHPTester.net fails – not by any deficiency, just because Godaddy is using default/recommended/smart security settings to disallow these remote connection attempts.
Why not try testing the database connection by opening a browser window pointed at the connection page you’re showing us?
I dont really get lucas’s answer but after creating a user you have to explicitely assign the user to the database.