Maverick Meerkat Posted February 20, 2011 Posted February 20, 2011 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?
jje Posted February 20, 2011 Posted February 20, 2011 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'.
Maverick Meerkat Posted February 20, 2011 Author Posted February 20, 2011 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?
Guest Geoff Posted February 21, 2011 Posted February 21, 2011 You will have to put an asterick '*' in the remote mysql boxin your cpanel.
Maverick Meerkat Posted February 22, 2011 Author Posted February 22, 2011 I hate to be a noob, but when I enter * it tells me it isn't a valid hostname. I tried %, which is the wildcard, but that doesn't help either.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now