Portal Home > Knowledgebase > Articles Database > database error
|Posted by Terryy, 07-27-2008, 06:21 AM|
|Hi i need some help as my database does not seems to work which i dont know why i get this msg on my site"Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: YES) in /home/msadmin/public_html/includes/connect.php on line 12
Cannot establish connection to MySql Server."
Im not sure if it is some problems with my other files, can anyone help me check what went wrong as i seriously got no idea what happen and i have upload the web files which u can download at http://www.2shared.com/file/3659691/...0/admincp.html
|Posted by TomHosting, 07-27-2008, 07:08 AM|
|i had similar problem before and instead of 'localhost', my hosting requires me to specify a 'subdomain.domain.tld'
some hosting requires specific port (?)
|Posted by Dark Light, 07-27-2008, 01:25 PM|
|Have you created a database and login credentials for that database on your hosting account or server?
If not, I'd suggest you do that and then enter those new details into your configuration file. If you do not know what I am talking about, contact your web host for assistance in setting up a database.
Hope that helps,
|Posted by Terryy, 07-28-2008, 08:41 AM|
|Hi, yeah i know what you're saying and yes i have created the database and assign my new created user to that database, isit any problems with the other files if anyone of you can help my check ??
|Posted by bear, 07-28-2008, 08:51 AM|
|This information appears incorrrect:
$db_user = "root";
db_pass = "root";
$database = "odinms";
You seem to be on a cpanel server, in which case the db name would be "msadmin_odinms", and the user would be "msadmin_whatever-username-you-created".
|Posted by Dark Light, 07-28-2008, 09:08 AM|
|I asked because it didn't seem, from your configuration file (that bear quoted), that you hadn't setup a database. You'd need to follow bear's instructions and modify your database login details.
Hope that helps,
|Posted by Terryy, 07-30-2008, 09:08 AM|
|I input this in the config.php file which is the same inside connect.php but still get the same error msg, anyone can advise what went wrong??
|Posted by Codebird, 07-30-2008, 09:14 AM|
|how is it that your user is msadmin_test1 and you're saying that the file is config.php and the error you displayed at the beginning is for root and it is in the file connect.php?!
|Posted by bear, 07-30-2008, 09:16 AM|
|Did you enter the password exactly as shown, or did you enter "123456" when you created the DB user?
|Posted by Terryy, 07-30-2008, 10:05 PM|
|I enter 123456 when i created the db user and now when i input just "123456" in both config.php and connect.php files, i get another error msg saying "cannot select database" ??
|Posted by bear, 07-30-2008, 10:47 PM|
|Connect.php files typically use the info from the config file, and don't need direct editing. Replace the edited connect file with the default one that came with your script and try again.
I don't know what your current files show, but the original had 2 different databases mentioned, the correct "msadmin_xxx" one and something called "odinms".
Connect.php should read (guessing here):
|Posted by Codebird, 07-31-2008, 04:58 AM|
|Now you are being connected to mysql but your database doesn't exist or the user u're connecting with doesn't have privileges on that database
|Posted by Terryy, 07-31-2008, 10:33 AM|
|Thanks for the help, managed to get the site up but it seems i have other errors as well if you go to my site you will see the msg all over at www.dreamzms.tk
|Posted by bear, 07-31-2008, 10:35 AM|
|Did you run the sql file as instructed? It's not finding the data it expects, so maybe the DB is empty...
|Posted by Codebird, 07-31-2008, 11:04 AM|
|or maybe the query is wrong at the end of each mysql_query() add or die(mysql_error());
it will be like this
$something=mysql_query(...) or die(mysql_error());
this way u'll get the errors mysql is giving
|Posted by Terryy, 08-01-2008, 08:00 AM|
|I have read the instructions and they say to run the .sql file included with the release which i indeed see one .sql file but i got no idea how to run it, anyone can advise?? thanks
|Posted by bear, 08-01-2008, 07:24 PM|
|Log into your Cpanel, find the icon for "Mysql Databases", and once in that section, scroll down to find phpmyadmin. There's a way from within that to import the data.
|Posted by Terryy, 08-05-2008, 09:09 AM|
|I imported that .sql file already but still the same...??
|Posted by Codebird, 08-06-2008, 09:28 AM|
|check your queries, the query maybe wrong like select a wrong field or something check your queries if u're sure the database is fine.
|Posted by Terryy, 08-09-2008, 10:43 PM|
|Basically its a kind a free script written by other people for free use and I got no idea how to check the queries as im new to all these sql stuffs and i have uploaded the sql file here if anyone can download it and check what went wrong....http://www.filefactory.com/file/902ff4/n/FlareCMS_sql
Thanks alot for helping
|Posted by bear, 08-10-2008, 06:41 AM|
|In phpMyAdmin, look at the tables in the database (click the table name, then click browse). Do they contain any data?
Add to Favourites Print this Article
SAN remount (Views: 285)