[resolved] Problem with Accessing MySQL on cPanel |
|
One of my clients is trying to use PHPED to access their MySQL databases remotely and make forms etc.
Basically, they have cPanel Hosting with us to which MySQL usernames are setup as accountusername_mysqldbusername and database names are setup as accountusername_databasename They are getting an error on trying to connect that states the following:
Note: xxxx means I have removed IP address and hostname details for security purposes. Could you please tell me why this could be occurring and explain what could be done to resolve it? We have allowed access through our firewall for the MySQL port and the DB user they have assigned to the DB in cPanel is assigned all privledges. Any ideas or suggestions are welcome? Regards, Dale |
||||||||||||||
_________________ HH |
Site Admin
|
Please read MySQL manual. If the server returns this error it means it. Nothing else. Your user account password is wrong. Most probably you granted all the priviledges to a different user while datainfo’@’xxx-xxx-xx-xx.xxx.xxxx.xxx.x' remained unpriveledged. |
||||||||||||||
_________________ The PHP IDE team |
Site Admin
|
scripts on the server CAN NOT use the same user name at least.
I know it is that. Please read MySQL manual.
PhpED is NOT involved at ALL. All authentication goes between mysql client library and mysql server ONLY. If server tells you that the authentication is not passed it means that user has NO grants. It means that you did NOT issue any grants to that user on the database you are trying to connect to, but issued necessary grants to the user that your scripts are using. Your scripts can not use the same username as PhpED after all because they are running on DIFFERENT hosts. That's MySQL FAQ. RTFM. |
||||||||||||||||||
_________________ The PHP IDE team |
Veteran
|
Dmitri is right, this is not a PhpED problem. A Cpanel server uses MySQL like any other web server would. The only thing that is "special", is that you can use the user friendly Cpanel control panel to create your databases and set up your users. From that point further, it's just another web server running PHP and MySQL.
The problem that you are experiencing is most likely that the database is not set up to allow connections from your client's IP addresses. By default, MySQL will allow connections from localhost (the server itself) only, and deny connections from remote IP addresses (such as the computer where PhpED is installed). To fix this, simply log in to your Cpanel and use the Remote MySQL function to add your client's IP address (i.e. the public IP address of the computer where PhpED is installed). |
||||||||||||
_________________ |
Site Admin
|
no, no. If it was the case, he would not get the error message stating Access denied for user ‘datainfo’@’xxx-xxx-xx-xx.xxx.xxxx.xxx.x' It's ABSOLUTELY clear that he granted rights only to datainfo@localhost or datainfo@127.0.0.1 or whatever local user he granted to, but DID NOT grant to datainfo’@’xxx-xxx-xx-xx.xxx.xxxx.xxx.x and it makes all the difference because mysql treats them as DIFFERENT users and this is CLEARLY described in mysql GRANT command |
||||||||||||||
_________________ The PHP IDE team |
Veteran
|
That's exactly what I was trying to say, but I guess it came out wrong
|
||||||||||||
_________________ |
|
I guess a number of issues could have caused this :
- skip-networking in my.cnf - wrong username used ( cPanel needs user_db as database name ) - last but not least, wrong password |
||||||||||||
|
Site Admin
|
If you connect to mysql from a php script using USERNAME as account name, the user name in fact will be USERNAME@127.0.0.1 If you connect to mysql from another computer using the same account name, the user name if fact will be USERNAME@<your computer IP> With mysql authentication system, you can GRANT privileges to USERNAME@%. In this case both ways will work. If you GRANT to USERNAME@127.0.0.1, only local connection will be accepted, while USERNAME@<your computer IP> will be rejected with "wrong password" error message, which is kinda confusing but that's what you can blame mysql at, not phped. |
||||||||||||||
_________________ The PHP IDE team |
|
Yep, I was blaming the regular code and server, and not phped
|
||||||||||||
|
[resolved] Problem with Accessing MySQL on cPanel |
|
||
Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by