Menu

Postfix Admin 3.1 and MySQL 8

2017-09-10
2019-12-08
  • Max Kostikov

    Max Kostikov - 2017-09-10

    I just moved my old Postfixadmin database on new server with MySQL 8 installed and got this issue when I trying to logon as adminisrator.

    DEBUG INFORMATION:
    Invalid query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'admin WHERE username='mxm@peek.ru' AND active='1'' at line 1

    Check your error_log for the failed query.

    User interface works as usual without any problems.
    Similiar issue happens when I trying to add new admin account on setup.php page

    DEBUG INFORMATION:
    Invalid query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'admin LEFT JOIN ( SELECT count(*) AS __domain_count, group_concat(domain) AS d' at line 1

    Check your error_log for the failed query..

     
  • Boris

    Boris - 2017-10-25

    I also have a lot of trouble with PA and MySQL 8. Don't want to give up on 8.0, but it seems there's no solution for postfix, at this moment

     
  • Peter

    Peter - 2017-11-23

    You can try to change in functions.inc.php - one line in function table_by_key
    from return $CONF['database_prefix'].$table;
    to return $CONF['database_prefix']."".$table."";

     
  • Masao Hattori

    Masao Hattori - 2019-12-08

    In addition to the above, if you have MySQL 8.0.2 or higher, change 'function create_page_browser' in 'functions.inc.php' as follows.
    diff postfixadmin-3.2/functions.inc.php{.default,}

    540,541c540,541
    <             SELECT $idxfield AS label, @row := @row + 1 AS row $querypart
    <         ) idx WHERE MOD(idx.row, $page_size) IN (0,$page_size_zerobase) OR idx.row = $count_results
    ---
    >             SELECT $idxfield AS label, @row := @row + 1 AS `row` $querypart
    >         ) idx WHERE MOD(idx.`row`, $page_size) IN (0,$page_size_zerobase) OR idx.`row` = $count_results
    
     

    Last edit: Masao Hattori 2019-12-08

Log in to post a comment.