northernknight
asked on
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
ASKER
I created a database user as "larry"
OK. What are you using to manage your databases and users? Cpanel? Phpmyadmin?
ASKER
Yes, Cpanel, MySQL, and PHPmyadmin
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?
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?
ASKER
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.
You're welcome.
Glad I could help!
Glad I could help!
ASKER
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"
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"
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.
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.
ASKER
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
I also found an error message in the database that I have attached.
database-error.JPG
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.
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.
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