1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.5 [MAJOR] An unexpected database error occurred. Please try again later.

Discussion in 'Installation, Upgrade, and Import Support' started by ncbetz, Jun 21, 2016.

  1. ncbetz

    ncbetz Formerly Noah Betz

    Hello,
    I just changed servers, and I created a new database to put it in (changed name, username, and password). I then imported everything. I think XenForo is looking for the old one still. How do I change it?

    Thanks,
    Noah
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

  3. ncbetz

    ncbetz Formerly Noah Betz

  4. ncbetz

    ncbetz Formerly Noah Betz

    Also, in Library, I have "config.php" and "config.default.php".
     
  5. Brogan

    Brogan XenForo Moderator Staff Member

    The error is a database error (one of Zend_Db_Exception types) which should have the error message in the page source.

    If it doesn't then you will likely need to contact your sysadmin or host for further troubleshooting and support.
     
  6. ncbetz

    ncbetz Formerly Noah Betz

    Code:
    <?php
    
    $config['db']['host'] = 'localhost';
    $config['db']['port'] = '3306';
    $config['db']['username'] = ‘USERNAME’;
    $config['db']['password'] = ‘PASSWORD’;
    $config['db']['dbname'] = ‘DATABASE NAME’;
    
    $config['superAdmins'] = '1';
    This correct?
     
  7. Brogan

    Brogan XenForo Moderator Staff Member

    No.

    You have used magic quotes for some of the entries - replace them with ''.
     
  8. ncbetz

    ncbetz Formerly Noah Betz

    Code:
    <?php
    
    $config['db']['host'] = “localhost”;
    $config['db']['port'] = “3306”;
    $config['db']['username'] = “USERNAME”;
    $config['db']['password'] = “PASSWORD”;
    $config['db']['dbname'] = “DATABASE NAME”;
    
    $config['superAdmins'] = “1”;
    So that? I changed the ' to "
     
  9. Brogan

    Brogan XenForo Moderator Staff Member

    I recommend downloading Notepad++ and using that to edit php files.

    You are still using magic quotes:
    Code:
    $config['db']['host'] = 'localhost';
     
  10. ncbetz

    ncbetz Formerly Noah Betz

    Code:
    <?php
    
    $config["db"]["host"] = “localhost”;
    $config["db"]["port"] = “3306”;
    $config["db"]["username"] = “user”;
    $config["db"]["password"] = “pass”;
    $config["db"]["dbname"] = “name”;
    
    $config["superAdmins"] = “1”;
    @Brogan - I have that now. All ' are now ".
     
    Last edited: Jun 21, 2016
  11. ncbetz

    ncbetz Formerly Noah Betz

    Also, Notepad++ is for Windows only.
     
  12. ncbetz

    ncbetz Formerly Noah Betz

  13. ncbetz

    ncbetz Formerly Noah Betz

    Code:
    <?php
    
    $config["db"]["host"] = "localhost";
    $config["db"]["port"] = "3306";
    $config["db"]["username"] = "user";
    $config["db"]["password"] = "pass";
    $config["db"]["dbname"] = "name";
    
    $config["superAdmins"] = "1";
    Aha! Fixed, I belive?
     
  14. Chris D

    Chris D XenForo Developer Staff Member

    That looks better and your site seems to be up.

    For future reference, Atom is a good cross platform text editor. It's developed by GitHub.
     
  15. ncbetz

    ncbetz Formerly Noah Betz

    Thanks, will look into this! I use Xcode currently. :D
     
  16. Tracy Perry

    Tracy Perry Well-Known Member

    TextWrangler for the win.
    I've been using it for a while on my Mac and love it.
     
    Infopro likes this.

Share This Page