Jump to content


Photo

MYSQL problem


  • Please log in to reply
6 replies to this topic

#1 Xteeahn

Xteeahn
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 30 August 2006 - 12:44 PM

Hey, I was trying to set up Snipe gallery from http://www.snipegallery.com/ and I got some mysql errors, as there support forum is closed I was hoping any of you could help me.

I ran through their installer, I set all the paths to where they needed to be. But as soon as I want to run Snipe it gives me this error

A database error has occured.

mySQL said: Access denied for user 'ODBC'@'localhost' (using password: NO)

SQL query: select id, name, created_on from snipe_gallery_cat where cat_parent='0'


I can see the error comes from table "snipe_gallery_cat" and it gives some errors from some of those fields.
But I dont know much of mysql so I got no clue what I need to do here.

This is how these fields looks like

Field        Type          Collation  Attributes  Null      Default  Extra
id        int(11)                                      No        auto_increment
name    varchar(200)      latin1_general_ci        Yes  NULL
created_on  datetime                                No  0000-00-00 00:00:00

And I am running on xampp http://www.apachefri...pp-windows.html


#2 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 30 August 2006 - 12:48 PM

your error is actually not in your query. it's in your permissions. you're trying to access the database with user "ODBC" without a password. do you have a user "ODBC" created with sufficient permissions to the database?
You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

#3 Xteeahn

Xteeahn
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 30 August 2006 - 01:10 PM

I'm not aware of any user ODBC, I havent set this user in Snipe's config file and neither in phpmyadmin.
I just tried adding user ODBC and gave him all privileges and now I get this error.

mySQL said: No database selected

SQL query: select id, name, created_on from snipe_gallery_cat where cat_parent='0'



#4 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 30 August 2006 - 01:38 PM

looks like you're never actually making a database connection. check the code (i'm not familiar with snipe), but somewhere you should havea mysql_connect() call and a mysql_select_db()
You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

#5 Xteeahn

Xteeahn
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 31 August 2006 - 11:00 AM

Well mysql_connect and mysql_select_db is not to be found in the config file nor anywhere else, but it seems to connect like this

$cfg_database_host = "localhost";

$cfg_database_user = "ODBC";

$cfg_database_pass = "";

$cfg_database_name = "fotosh";



#6 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 31 August 2006 - 12:30 PM

that's not connecting, that's simply assigning your connection variables. notice that the snippet you posted is not calling any functions at all. with those variables, you'd have to make a connection like this:
<?php
$conn = mysql_connect($cfg_database_host, $cfg_database_user, $cfg_database_pass);
mysql_select_db($cfg_database_name, $conn);
?>

apparently, though, based on your original post, there is a connection being attempted SOMEWHERE because of the error you were receiving.
You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

#7 Xteeahn

Xteeahn
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 01 September 2006 - 02:00 PM

So I found the file where the connection is being attempted

if ((!is_dir($cfg_admin_path)) || (!file_exists($cfg_app_path."/inc/config.php"))) {
$path_error = 1;
$is_error = 1;
} else {
if (!@mysql_pconnect($cfg_database_host,$cfg_database_user,$cfg_database_pass))
die('<span class="errortxt">FATAL ERROR: cannot connect to mySQL server <br>host: '.$cfg_database_host.' <br>user: '.$cfg_database_user.' <br>password: '.$cfg_database_pass.' </span>');
if (!@mysql_select_db($cfg_database_name))
die('<span class="errortxt">FATAL ERROR: I cant make up my mind!! Cannot select MySQL database "'.$cfg_database_name.'"</span>');

But it looks like to me that I am making a database connection.
And whenever I try to reach this page I get the error stated in the code

FATAL ERROR: cannot connect to mySQL server
host: http://localhost/
user: ODBC
password:






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users