Jump to content

Recommended Posts

Posted

I created a database called hathix_cabra and created a user (we'll call them hathix_user) with the password,say, 'pass123'. I wrote the following PHP code to try to connect to the database:

 

$dbc = mysqli_connect('cabra.hathix.com','hathix_user','pass123','hathix_cabra') or die('Error connecting to MySQL server.');

 

Sure enough, I get an error about 'access denied' (or sometimes just the generic error message.) I've given the user all privileges, but when I try to FLUSH PRIVILEGES in phpMyAdmin I get an 'access denied' message.

 

I get this specific error message:

[28000] [1045] Access denied for user 'hathix_cabra'@'xxx.xxx.xxx.xxx' (using password: YES)

Sometimes it's 1044 instead of 1045.

 

Am I using the wrong values, or is something else the matter?

Posted

Your doing everything right, except the host (cabra.hathix.com) should be either:

- 'localhost' if you're connecting locally.

- 'stevie.heliohost.org' if you're connecting remotely.

 

If you're connecting remotely you need to enable Remote SQL in cPanel.

 

Moving to 'Questions'. ;)

Posted

I tried 'localhost' as the host in my PHP script, but that didn't work (I got the generic 'error connecting to database' message.) I tried entering 'stevie.heliohost.org' as a remote access host but it didn't show up, and when I tried 'stevie.heliohost.org' as the host in the script that didn't work either (same generic message.)

 

Did I enable the remote SQL wrong or something?

Posted

You will have to put an asterick '*' in the remote mysql boxin your cpanel.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...