Jump to content

Archived

This topic is now archived and is closed to further replies.

Xteeahn

MYSQL problem

Recommended Posts

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

[quote]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' [/quote]

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
[quote]
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
[/quote]
And I am running on xampp [url=http://www.apachefriends.org/en/xampp-windows.html]http://www.apachefriends.org/en/xampp-windows.html[/url]

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.
[quote]mySQL said: No database selected

SQL query: select id, name, created_on from snipe_gallery_cat where cat_parent='0' [/quote]

Share this post


Link to post
Share on other sites
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()

Share this post


Link to post
Share on other sites
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
[quote]
$cfg_database_host = "localhost";

$cfg_database_user = "ODBC";

$cfg_database_pass = "";

$cfg_database_name = "fotosh";
[/quote]

Share this post


Link to post
Share on other sites
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:
[code]
<?php
$conn = mysql_connect($cfg_database_host, $cfg_database_user, $cfg_database_pass);
mysql_select_db($cfg_database_name, $conn);
?>
[/code]

apparently, though, based on your original post, there is a connection being attempted SOMEWHERE because of the error you were receiving.

Share this post


Link to post
Share on other sites
So I found the file where the connection is being attempted
[quote]
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>');
[/quote]
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
[quote]
FATAL ERROR: cannot connect to mySQL server
host: http://localhost/
user: ODBC
password:
[/quote]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.