Xteeahn Posted August 30, 2006 Share Posted August 30, 2006 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 Extraid int(11) No auto_incrementname varchar(200) latin1_general_ci Yes NULLcreated_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] Quote Link to comment Share on other sites More sharing options...
obsidian Posted August 30, 2006 Share Posted August 30, 2006 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? Quote Link to comment Share on other sites More sharing options...
Xteeahn Posted August 30, 2006 Author Share Posted August 30, 2006 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 selectedSQL query: select id, name, created_on from snipe_gallery_cat where cat_parent='0' [/quote] Quote Link to comment Share on other sites More sharing options...
obsidian Posted August 30, 2006 Share Posted August 30, 2006 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() Quote Link to comment Share on other sites More sharing options...
Xteeahn Posted August 31, 2006 Author Share Posted August 31, 2006 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] Quote Link to comment Share on other sites More sharing options...
obsidian Posted August 31, 2006 Share Posted August 31, 2006 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. Quote Link to comment Share on other sites More sharing options...
Xteeahn Posted September 1, 2006 Author Share Posted September 1, 2006 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 serverhost: http://localhost/user: ODBCpassword:[/quote] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.