No DB connect on windows

Hi, because I'd like to do some local testing on a windows box (running xampp e.g. apache2), and don't want to dual boot all the time, I'd like to know the answer to the following question. If it' allready been answered elsewhere and I just wasn't clever enough to find the post, I apologize.
So here we go.
I got everything unpacked and adjusted config.php
The install process went well and I uploaded some pics.
However, when I point my browser to 127.0.0.1/testlab/zenphoto afterwards to look at the albums, I get the followin php error:
` MySQL Error: Could not connect to the database server. `

`Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:Programmexampphtdocstestlabzenphotozenfunctions-db.php on line 31 `

`Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:Programmexampphtdocstestlabzenphotozenfunctions-db.php on line 31

MySQL Query ( SELECT *, (date + 0) AS date FROM albums WHERE `folder`='12er-party-05' LIMIT 1; ) Failed. Error: Access denied for user 'ODBC'@'localhost' (using password: NO) `

I really don't have time right now to work myself into the zenphoto code, so it would be really cool if someone could help me with this.

Regards, EverNever

Comments

  • The permissions for the user aren't correct. You need to check the config.php for the database username and password. After you have done this, make sure the user exists in MySQL and that you have specified the correct password.

    MySQL is saying that the user name either doesn't exist or the permissions aren't correct. It has nothng to do with the php code.

    Check the MySQL docs for more information
  • Sorry, but your explanation would make sense if I there was "ODBC" specified as a user, and no password specified.
    However, I did edit the relevant config.php section to look like this:
    `$conf['mysql_user'] = "root";

    $conf['mysql_pass'] = "XXXXXXXX";

    $conf['mysql_host'] = "localhost"; // Probably won't need to change this.

    $conf['mysql_database'] = "zenphoto_testlab"; `
    (replace XXXXXXXX with real pwd)
    The interesting thing also is (maybe I didn't make this clear enough above), that I am able to login into the admin interface, "only" the frontend has this behaviour. If I had to make a guess it would be that some part of the code doesn't (properly) use either config.php or the functions defined in functions-db.php, because a user "ODBC" just wasn't specified anywhere by me, so I conclude it has to be hardcoded somewhere.
    Any idea where? Or am I getting something essentially wrong here?
  • Start up MySQL from the command line and see if you can log in using the username and password you are using in your config.php file.

    If that works, you can try searching for 'ODBC' somewhere in the code, but I'm pretty sure it's not there. If it is, then try to find out where in the code is appears and post another note.
  • I logged in through the commandline and it worked. the following command was used: ` C:Programmexamppmysqlbin> mysql.exe --host=localhost --database=zenphoto_testlab --user=root --password=XXXXXX `
    phpMyAdmin did also work, so php to mysql can't be broken either.
    I searched for 'ODBC' in all of zenphotos php files, but it was nowhere to be found.
    I know it wouldn't make any sense to have something named 'ODBC' in there, because zenphoto is mysql only, but I just don't get how zenphoto's main page came across that user name. I don't know what to check for anymore. Any ideas what I could check for or something I could send you to check for validity? Like my config.php?
    Regards, EverNever
  • I'm afraid I am at a loss. Is your zenphoto running on a Windows server or a Unix server? If it's Windows, you may want to search the forum and see if anyone else has had this problem.
    Sorry I couldn't be more help.
  • Did some more looking around and I still haven't found anything. I've got it running on a Windows box at home and it works fine.
    You might want to check and make sure you have the right version of MySQL. This is a shot in the dark, but who knows?
  • It's running locally on a windows machine, and would have been swapped to a linux server on the net, once I'd been sure that it really suits my needs. Thanks anyway for trying to help. I'll post a small note if I come up with something useful.
  • I had exactly the same problem running with xampp for windows. I had two problems (both the ODBC problem and the mod rewrite being left enabled (oops)) so here's what I did:
    1. Enabled mod rewrite to the httpd.conf config by uncommenting out the module
    2. Added require_once("zen/config.php"); to the top of my index.php file
    3. Edited the .htaccess file to point to the proper folder
    I imagine that disabling mod-rewrite in the config.php might also help.

    I'm not sure exactly what causes this problem but it seems like the config.php file was not loaded correctly and it would be nice to have an error and a possible solution for this.
Sign In or Register to comment.