• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 154
  • Last Modified:

Login problem with PHP/MySQL page

I loaded a website and SQL database that was on the domain, hollywoodcolorcontacts.com onto the domain topmodelcolorcontacts.com .  I am getting an access denied when trying to open the website from a browser.    I changed the PHP config file to use the new domain but I am still getting the same error.  Below is the part of the config file info:

("Location: login.php");
   exit;
}

// Set the location to the admin installation here.
$CONF['site_url'] = 'http://www.domain.com/';
$CONF['admin_url'] = 'http://www.domain.com/admin/';
$CONF['admin_path'] = '/path/admin/';
$CONF['base_path'] = '/path/';
$CONF['font_path'] = '/path/htdocs/Fonts/';

//log file
$CONF['log'] = $CONF['admin_path'] . 'includes/test_misc_log';

///ip
$CONF['server_ip'] = '000.000.000.000 ';


// Language config
$CONF['default_language'] = 'en';
// Database Config
// mysql = MySQL 3.23 and 4.0
// mysqli = MySQL 4.1
$CONF['database_type'] = 'mysqli';
$CONF['database_host'] = 'localhost';
$CONF['database_user'] = 'something';  ///this is set to equal the db name
$CONF['database_password'] = '**********';
$CONF['database_name'] = 'something';
$CONF['database_prefix'] = '';

///define session timeout
$CONF['session_timeout'] = 36000;

// Site Admin
// Define the Site Admins email address below.
$CONF['admin_email'] = 'txxxxx@xxxxx.com';
$CONF['support_email'] = 'support@hdomain.com';
$CONF['dm_email'] = 'sales@domain.com';
// Mail Server
// Hostname of the mail server.
$CONF['smtp_server'] = 'xxx.xxx.xxx.xxx';
$CONF['smtp_port'] = '25';
$CONF['smtp_timeout'] = '30';

// Page Size
// Set the number of entries that you would like to see
// in one page.
$CONF['$paging'] = array(25,50,75,100);

// Footer

Open in new window

0
northernknight
Asked:
northernknight
  • 7
  • 6
1 Solution
 
Dan CraciunIT ConsultantCommented:
Access denied for user 'larry'@'localhost' (using password: YES)
This usually means your password or your user name is incorrect.


I loaded a website and SQL database
Have you also created a user and gave him rights on that SQL database?

I see you have this on your config:
$CONF['database_user'] = 'larry';  ///this is set to equal the db name

But your db name is
$CONF['database_name'] = 'HCC_admin';

Maybe this is the problem?

PS: please make this question "Private", so it's not accessible from a web search. You put a LOT of info online and if any automated (or not) bots get hold of this info you'll find pretty soon attempts to hack your site.

HTH,
Dan
0
 
northernknightAuthor Commented:
I created a database user as "larry"
0
 
Dan CraciunIT ConsultantCommented:
OK. What are you using to manage your databases and users? Cpanel? Phpmyadmin?
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
northernknightAuthor Commented:
Yes, Cpanel, MySQL, and PHPmyadmin
0
 
Dan CraciunIT ConsultantCommented:
OK. In Cpanel, when you go to "MySQL Databases", do you have a db called "HCC_admin"?
And, on it's right, in the "Privileged user" column, a user named "larry"?

Most webhosts will prefix your user and db name with a string. Is this the case with your webhost?

Can you post a screenshot with the "MySQL Databases" page?
0
 
northernknightAuthor Commented:
Yes I have a database with HCC_admin and it has a prefix
I created a user called larry but I don't have "privileged users"MySQL screenshot
0
 
Dan CraciunIT ConsultantCommented:
You have this: Add User to database. Press on "Add" and you'll set up "topmodel_larry" as a privileged user for the db "topmodel_HCC_admin"

And change
$CONF['database_user'] = 'larry';  ///this is set to equal the db name
$CONF['database_password'] = '**********';
$CONF['database_name'] = 'HCC_admin';

to
$CONF['database_user'] = 'topmodel_larry';  
$CONF['database_password'] = '**********';
$CONF['database_name'] = 'topmodel_HCC_admin';
0
 
northernknightAuthor Commented:
Great, that worked!  thank you very much.  I did try using the prefix in the config file before but I never made the user privileged.
0
 
Dan CraciunIT ConsultantCommented:
You're welcome.

Glad I could help!
0
 
northernknightAuthor Commented:
Hey Dan,

Looks like the website is working fine.  I have not been able to login to the admin.  Shouldn't the admin be the topmodel_larry user and the password I created?  I tried both "larry" and "topmodel_larry"
0
 
Dan CraciunIT ConsultantCommented:
Nope. That's the user for the database.

The admin user should be different. You can usually find the name and password in the table "user" or "users" in your database, but the password will be encrypted.
0
 
northernknightAuthor Commented:
In the phpMyAdmin it has an "admin" section in the database but there is no "user" table - I see that there are 3 what looks like users in that table one in which has the name larry.

I also found an error message in the database that I have attached.
database-error.JPG
0
 
Dan CraciunIT ConsultantCommented:
I don't recognize the table names, so it's probably a custom CMS.
You should contact the original developer for the name and password of the admin user. It might be in the db or it might be hard-coded in a file.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 7
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now