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

XF 1.5 Where To Enter SQL Commands?

Discussion in 'XenForo Questions and Support' started by LT Jennifer, Oct 23, 2015.

  1. LT Jennifer

    LT Jennifer Member

    I've searched this forum and have seen a number of SQL commands to directly access the database.

    But they don't say WHERE to enter the commands. My questions:

    (1) Does XenForo provide a place to type in SQL queries?

    (2) Do you need to enter a USE command or is that automatic?

    (3) Or do you have to log on to your database using a separate SQL client?

  2. Andrej

    Andrej Well-Known Member

    You can connect to MySQL over SSH, or you can use phpMyAdmin under the SQL tab where you can enter the query.
  3. Brogan

    Brogan XenForo Moderator Staff Member

    In general you shouldn't have to run queries on the database directly and it's not something we would typically recommend.

    If you do, ensure you take a backup first.
  4. tajhay

    tajhay Well-Known Member

    If you want to run SQL commands directly from the xenforo ACP - you can do so using this addon - https://xenforo.com/community/resources/querier.2389/

    Quite useful wihtout having to log into phpMyAdmin etc.

    Edit - you need to know the table and column names though. That information doesnt get exposed. Its only an SQL Query form but enables you to quick select / update etc whatever you need to do.
  5. LT Jennifer

    LT Jennifer Member

    @tajhay: so Querier doesn't allow SHOW DATABASES or SHOW TABLES then?

  6. tajhay

    tajhay Well-Known Member

    Its allows you to put sql commands and shows results of the query.
  7. SneakyDave

    SneakyDave Well-Known Member

    You might be restricted from using SHOW DATABASES if you're using the MySQL user assigned to your XenForo forum. You might need to be connected as the root or privileged user to see that.

    I'd suggest using phpmyadmin or the native command line if you need to view db info.
    Last edited: Oct 23, 2015

Share This Page