Don't understand database info for installation

Hi all,

I have installed zenphoto before, but I have since moved to a new host and I'm trying to do a clean install. I cannot for the LIFE of me remember how to write the database info.

First, I added the new database (named zenphoto) in MySQL databases. Then I added the user (named susan) and added a unique password (not shown below). Then I added the new user to the database.

Then in the config file, I wrote it like this:

$conf['mysql_user'] = "fivenel9_susan";
$conf['mysql_pass'] = "password";
$conf['mysql_host'] = "localhost"; // Won't need to change this 90% of the time.
$conf['mysql_database'] = "fivenel9_zenphoto";

What am I doing wrong because what I get when trying to run the setup is:

MySQL Error: Could not connect to the database server. Check your zp-config.php file for the correct Host, User name, and Password.

Can anyone help me? TIA!

Comments

  • I use godaddy for hosting, and I had to replace "localhost" with the location of the mySQL host.
  • Thank you for your reply. I use anhosting and inside the database page, it actually says "localhost", so I don't think I need to change that, do I?
  • Does your host have cPanel/phpmyadmin?

    My host gives me a snippet like this on the database page:

    PHP `$dbh=mysql_connect ("localhost", "awilson_guser", "") or die ('I cannot connect to the database because: ' . mysql_error());

    mysql_select_db ("awilson_gallerydb");`

    which should show you at least the host, username, and database name so you can confirm they are correct.
  • Yes, I have cpanel. On the database page, this is what it says:

    Connection Strings
    Perl $dbh = DBI->connect("DBI:mysql:fivenel9_photos:localhost","fivenel9_photos","<PASSWORD HERE>");
    PHP $dbh=mysql_connect ("localhost", "fivenel9_photos", "<PASSWORD HERE>") or die ('I cannot connect to the database because: ' . mysql_error());
    mysql_select_db ("fivenel9_photos");
  • trisweb Administrator
    If you're absolutely sure you've got the right info in the config file, there is an obscure possibility -- the MySQL client could be using the old form of the password for connections, while the newer server might be expecting the new form, which is a longer hash.

    You can read about that here... might help:

    http://dev.mysql.com/doc/refman/5.0/en/old-client.html
  • Thank you for your reply. When I moved hosts, I just deleted everything I had before. This is a brand new install of ZP on my new host's server. It's AnHosting.

    Thank you for the link. I'm not sure I understand any of it, but I will look into it.
  • Your first post said your user was `fivenel9_susan` and your database was `fivenel9_zenphoto`, but from what you posted, it looks like both are `fivenel9_photos`
  • Yeah, I changed it. I deleted the susan/zenphoto because I thought maybe I had done it wrong. But I don't think I have it wrong. It just isn't working for me.
  • I still can't make heads or tails of this. I'm open to any other suggestions. :)
  • trisweb Administrator
    Do you have any other database-using applications on your site? Wordpress for example?

    Check their settings and make sure they match those for Zenphoto.

    Also make sure that the database you're using has specific permissions set for the user you're using. You can use phpMyAdmin to check that...
  • Yes, I have Wordpress installed. Here's what it says in the MySQL Database page:

    ivenel9_wrdp1 (Privileges: ALL PRIVILEGES)

    Connection Strings
    Perl $dbh = DBI->connect("DBI:mysql:fivenel9_wrdp1:localhost","fivenel9_wrdp1","<PASSWORD HERE>");
    PHP $dbh=mysql_connect ("localhost", "fivenel9_wrdp1", "<PASSWORD HERE>") or die ('I cannot connect to the database because: ' . mysql_error());
    mysql_select_db ("fivenel9_wrdp1");

    And then here's what I have currently for Zenphoto:

    fivenel9_photos (Privileges: ALL PRIVILEGES)

    Connection Strings
    Perl $dbh = DBI->connect("DBI:mysql:fivenel9_photos:localhost","fivenel9_photos","<PASSWORD HERE>");
    PHP $dbh=mysql_connect ("localhost", "fivenel9_photos", "<PASSWORD HERE>") or die ('I cannot connect to the database because: ' . mysql_error());
    mysql_select_db ("fivenel9_photos");

    To my untrained eye, it looks like everything matches. Do they to you?

    I don't understand how to check that the database has specific permissions set using phpMyAdmin. When I go into phpMyAdmin, nothing shows up for the Zenphoto user. I mean, the user is in the dropdown list, but then there's no information available on it.

    I'm sorry if I seem to be asking dumb questions. I just really want to get this working because I know how wonderful Zenphoto is.
  • Is susan the name you used when you signed up for with the webhost? (then, it should be your login name)
    If so, it should be:

    susan_somethingdb
    susan_myname

    I make the names easy to remember like: User = susan_zen, db = susan_zendb

    knotty
  • trisweb Administrator
    Looks like the settings should be:

    `$conf['mysql_user'] = "fivenel9_photos";

    $conf['mysql_pass'] = "";

    $conf['mysql_host'] = "localhost"; // Won't need to change this 90% of the time.

    $conf['mysql_database'] = "fivenel9_photos";`

    Try those and see if that works....

    Otherwise, try using the wordpress settings and adding a table prefix (the next config option), it should be able to use the Wordpress tables without any problem:

    `$conf['mysql_user'] = "fivenel9_wrdp1";

    $conf['mysql_pass'] = "";

    $conf['mysql_host'] = "localhost"; // Won't need to change this 90% of the time.

    $conf['mysql_database'] = "fivenel9_wrdp1";

    $conf['mysql_prefix'] = "zp_";

    `
  • trisweb Administrator
    @knotty, I think since her Wordpress tables look like `fivenel9_wrdp1` then the login is probably `fivenel9`. Good to check, though.
  • Okay, I made sure I had the same thing you did with photos as the username/database name and it still doesn't work. So, now I'm trying to use the wordpress settings. However, I installed Wordpress using Fantastico. I didn't assign the password and I don't know how I can find out what it is. Is this something about which I need to contact my host?
  • trisweb Administrator
    Susie, would you be willing to let me have access to your server to help you fix this? I promise I won't break anything :-) If so, send me an email at trisweb at this site's domain.
  • Hi,

    I just sent you two emails (the second an update to the first). It'll be from Susan [at] TheWebDesignLoft [dot] com.

    Thank you very much!!

    ~Susie
  • trisweb Administrator
    Fixed :-)

    The problem was very interesting -- the zp-config.php file got garbled with HTML, which is probably a consequence of that file manager from cPanel, which is horrible. Next time, use FTP to download the file, edit in notepad or other *real* text editor, and re-upload.

    Also, in the future, it's good to give all details about the problem, like the fact that the entire zp-config.php file was printed on the front page of your Zenphoto install, and the whole MySQL error string printed below it, which had "nobody" as the user, indicating that the zp-config.php file could not be read.

    I'll be putting a check for this in the setup. Thanks for letting me debug on your server; I've deleted the email and already can't remember the password ;-)
  • I can't tell you how much I appreciate what you've done for me! I'm sorry I didn't give all the info when the problem was happening. I guess I didn't want to post the page since it had sensitive info on it, and I didn't think of just describing it with words. Lesson learned. And I usually do use my text editor, but I didn't this time. Another lesson learned.

    Thanks again!! :-)
  • courd Member
    Did you post a fix for this problem somewhere? I'm getting the same one and I did use notepad to edit my setup.php file.
  • trisweb Administrator
    courd, that could be a different problem. Can you give us more information, like your site address? You could also start a new topic for a new support request, that's preferred.
Sign In or Register to comment.