Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
May 24, 2012, 02:29:53 AM

Pages: [1]   Go Down
  Print  
Author Topic: How to get PHP to access MySQL?  (Read 2271 times)
cactu7
Newbie
*
Offline Offline

Posts: 1


« on: September 02, 2010, 02:30:32 PM »

I've been trying for a couple of days now.

My programs (pages) worked great on Zend using localhost.  I transfered the programs to my site hosted on lunar pages AND made appropriate changes to host name, database name, user name, and passwords.  I tried every available combination.  The mysql is working fine from phpmyadmin on the lpcp, but I get:

"Could not connect to MySQL: Access denied for user 'guest'@'chi.lunariffic.com' (using password: YES)"

from the program.  Why is the "Access denied"?
ideas anyone?
« Last Edit: September 02, 2010, 02:36:28 PM by cactu7 » Logged
katrina1
Guest
« Reply #1 on: September 02, 2010, 10:33:54 PM »

Please be sure you are NOT using localhost for the server. Chi uses lpsql01.lunariffic.com  as the database server. Also, the username guest is not correct. Please look at the username as it appears under Mysql in LPCP and update your script to match.
Logged
Brru
Newbie
*
Offline Offline

Posts: 2


« Reply #2 on: April 30, 2011, 02:14:23 AM »

I am having a similar issue and I assume a similar answer, so I didnt create a new tag for this.

I'm attempting to write a php script to access MySql and I get this error:

Connect failed: Access denied for user ''@'localhost' to database 't******_example'

I AM using Localhost (obviously), I've verified users are permitted: ALL, user and password are correct, and even attempted to use the DB Server IP address from MySQL Manager in case localhost wasn't the proper server. Oh, I also tried appending the "user@IP address" from the MySQL Manager as well. Im a bit concerned with the fact that it's not displaying the username before the @. It's got to be something easy I'm missing here. Hope someone can help.
Logged
katrina1
Guest
« Reply #3 on: April 30, 2011, 03:49:46 AM »

We would need a URL and which control panel you are on, Cpanel or LPCP, to help. Cpanel would use "localhost" for the DB hostname while LPCP would use either the full Mysql server name or the Mysql server IP address for the hostname. The user must be added to the database in both control panels. Be sure to use the full username in the connection which will be cpaneluser_dbuser (ignore the @ and everything after for LPCP).
Logged
Brru
Newbie
*
Offline Offline

Posts: 2


« Reply #4 on: May 02, 2011, 01:22:11 AM »



How do I access Cpanel? Im using LCPC (with MySQL Manager) and I've been using serveruser_user as the username. I've never used Cpanel and Im new to databases in general. I would like to try changing the users in both cpanel and LCPC, but I'm assuming CPanel is the initial control panel when I first login into Lunarpages website.
« Last Edit: May 02, 2011, 11:58:07 AM by Brru » Logged
Pages: [1]   Go Up
  Print  
 
Jump to: