Jump to content

Cant connect / access denied - I know its redundant, sorry


fairyfan

Recommended Posts

I cannot connect to ANY database I make in the CPanel. Here is all the info:

 

hostname - Localhost

user - xxxxx_xxxxxx

pass - xxxxxx

db name - xxxxx_dbname

 

error message via the script (auto table set up script -the script is trying to creat tables using the above user/pass)

 

This is a php script that auto installs tables in the db for you. Now I do everything via my Control Panel on Linux. I dont think I need to give privilages (there is no spot on the Cpanel to do so either) as they are there if I try to create tables by hand via phpmyadmin.

 

::Installation ::

 

Second step:

Checking validity of data and creating tables.

 

 

Warning: mysql_connect() [function.mysql-connect]: Can\'t connect to local MySQL server through socket \'/var/tmp/mysql.sock\' (2) in /home/username/public_html/script/scriptcall.php on line 55

The script tried to connect to the MySQL database, however it was impossible to establish connection. There are two cases why this happened. The first is that the MySQL server is not open. The second case is that you haven\'t set scriptcall.php variables correctly. Please, check the variables again

 

Now I know the above variables are correct

 

Now if I change the variables to the following:

 

hostname - www.my-site.com

user - xxxxx_xxxxx

pass - xxxxx

db name - xxxxx_dbname

 

This is the error I get:

 

Installation

 

Second step:

Checking validity of data and creating tables.

 

 

Warning: mysql_connect() [function.mysql-connect]: Access denied for user: \'xxxxx-xx_xxxxx@ip address\' (Using password: YES) in /home/username/public_html/script/scriptcall.php on line 55

The script tried to connect to the MySQL database, however it was impossible to establish connection. There are two cases why this happened. The first is that the MySQL server is not open. The second case is that you haven\'t set scriptcall.php variables correctly. Please, check the variables again.

 

Without giving out all my info here I hope I have given some of you sql gurus enough to go on as to why this is happening. Also, I dont think my hosting company is allowing me \"root\" access to the sql server. I am on a reseller acct. with WHM and can restart sql server but I dont know that I can do much more than that.

 

Thanks you guys

 

Kerr

Link to comment
Share on other sites

This is the command line on line 55

 

if(!($mysql = mysql_connect($hostname, $username, $password))

 

 

maybe that will shed some extra light?

 

:?

 

Try changing your host to localhost. Most servers are set up that way as a security measure.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.