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

XF 1.2 SQL name change and problems

Discussion in 'Troubleshooting and Problems' started by Moshe1010, Jul 19, 2013.

  1. Moshe1010

    Moshe1010 Well-Known Member

    Hi,

    I've changed the username of the entire account on my server (DirectAdmin), and XenForo stopped working with the error (after plugging in the new SQL details):

    Code:
    An exception occurred: Mysqli prepare error: Table 'xenforovb2_Xenforo.xf_option' doesn't exist in /home/xenforovb2/domains/**/public_html/library/Zend/Db/Statement/Mysqli.php on line 77
    
    Zend_Db_Statement_Mysqli->_prepare() in Zend/Db/Statement.php at line 115
    Zend_Db_Statement->__construct() in Zend/Db/Adapter/Mysqli.php at line 381
    Zend_Db_Adapter_Mysqli->prepare() in Zend/Db/Adapter/Abstract.php at line 478
    Zend_Db_Adapter_Abstract->query() in Zend/Db/Adapter/Abstract.php at line 825
    Zend_Db_Adapter_Abstract->fetchOne() in XenForo/Error.php at line 48
    XenForo_Error::unexpectedException() in XenForo/Application.php at line 329
    XenForo_Application::handleException()

    I get the idea that a table is missing in my SQL, but why would a table delete itself by a database name change without moving the database anywhere outside the server (or even inside the server)?

    Thanks.
     
  2. Jeremy

    Jeremy XenForo Moderator Staff Member

    Can you access the site at all? Some servers directly like usernames to database names. So a change in that may cause a change in your DB name unexpectedly (I doubt it, but it's worth looking at). If you access the database via PhpMyAdmin, do you see the table?
     
  3. Moshe1010

    Moshe1010 Well-Known Member

    I cannot access my site at all. The error appears on the top of every page you try to access to (including admin.php).
    And no, via PhpMyAdmin, I cannot find the table "xf_option".

    This is what I did via SSH:
    Code:
    [root@server ~]# cd /usr/local/directadmin/scripts
    [root@server scripts]# ./change_username.sh testing xenforovb2
    And then it died.
     
  4. Jeremy

    Jeremy XenForo Moderator Staff Member

    Are the rest of your XenForo tables present? Do you have a database backup you can restore this table from?

    I'm not sure what your rename did to cause this tho.
     
  5. Moshe1010

    Moshe1010 Well-Known Member

    I would need to dig deeply in order to find a backup for this Dev account, so I prefer to avoid it.
    I'm not sure if the rest of the XF tables are present. They do, but when I click on them, they aren't? Weird:
    http://img594.imageshack.us/img594/6803/o8c4.png

    I guess everything is gone except search index?
    If yes, that's super weird.
     
    Last edited: Jul 19, 2013
  6. Jeremy

    Jeremy XenForo Moderator Staff Member

    Indulge me for a minute... In your XenForo config, change your database from xenforovb2 to directadmin (or to whatever you renamed it to).
     
  7. Moshe1010

    Moshe1010 Well-Known Member

    I renamed that from testing to xenforovb2
     
  8. Jeremy

    Jeremy XenForo Moderator Staff Member

    Was the name originally testing_x and you changed it to xenforovb2_x? Try reverting the updates to XenForo config. If that doesn't work, I'll let someone far more knowledgeable with servers help you, since I am out of guesses.
     
  9. Moshe1010

    Moshe1010 Well-Known Member

    Yes, the original database was testing_x, and I've changed it to xenforovb2_x.
    What do you mean by "Try reverting the updates to XenForo config"?
     
  10. Jeremy

    Jeremy XenForo Moderator Staff Member

    Change the database name back to testing_x.
     
    Moshe1010 likes this.
  11. Moshe1010

    Moshe1010 Well-Known Member

    That solved the problem, but what the hack is going on here?

    That's insane because when I change the SQL name (by a username change), it reduces the DB by half, meaning it deletes EVERY SINGLE TABLE, and leaves just the search index (Elastic Search).

    When I've changed the SQL username, the DB reduced to 650MB. Currently, when I changed it back to "testing" username, it came back to 1.3GB.
    What's going on here?
     
    Jeremy likes this.
  12. Jeremy

    Jeremy XenForo Moderator Staff Member

    I have no idea, but I'm glad it worked.
     
  13. Moshe1010

    Moshe1010 Well-Known Member

    Apparently, this is a known bug in DirectAdmin's script that changed the account username and breaks the databases.
     
  14. EasyTarget

    EasyTarget Well-Known Member

    You can set it so only certain users can see certain db's.
    the new user name didn't have access to see the database.
     
  15. Moshe1010

    Moshe1010 Well-Known Member

    I can see the databases under this account, but the databases are not complete.
     
  16. EasyTarget

    EasyTarget Well-Known Member

    Grant all mysql permissions to the user.
     
  17. leslie dow

    leslie dow Active Member

    Hi
    I've had exactly the same thing happen or very nearly the same, I am getting the same error messages but when I look in the database that table is there and appears to be complete. This happened after I moved my site to a VPS, in the process my hosting company changed the names of the databases and the username. It went from (username/db name) Savvy_XF/XF to savvyaut_SavvyXF/savvyaut_XF. Just so I am clear on what you did to fix this. I need to revert the name of the database to XF and the username to SavvyXF? That should fix this?

    I am confused as well since this error happened after I confirmed that XF was running on the new VPS. I saw the error when I tried to install ArrowChat (not sure if that caused anything or was just coincidental) I was in the middle of the ArrowChat installation and wanted to check something so I launched XF and got the error. I, too, cannot access any page inlcuding the Admin.

    I figured I'd post here and see if any new ideas on this. I'm also going to try to do the changes that worked before.
    Thanks
     
  18. leslie dow

    leslie dow Active Member

    ..And no that did not fix it for me. I'm going to poke around a bit more. And I do have a backup of the database that I can use to restore. I'll try that next.
     
  19. leslie dow

    leslie dow Active Member

    ..and I figured it out. Turns out when they did the move they changed the case of the table names. I found a few that had to be changed from lower to upper case. Once I did that all was good. I suspect there are a few more so I am doing a check of table names from the old database to the new one. What was helpful was that the error message changed to tell me what table names needed to be change. Nice!
    :)
     

Share This Page