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..
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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."";
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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$idxfieldASlabel,@row:=@row+1ASrow$querypart<)idxWHEREMOD(idx.row,$page_size)IN(0,$page_size_zerobase)ORidx.row=$count_results---> SELECT $idxfield AS label, @row := @row + 1 AS `row` $querypart>)idxWHEREMOD(idx.`row`,$page_size)IN(0,$page_size_zerobase)ORidx.`row`=$count_results
Last edit: Masao Hattori 2019-12-08
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
User interface works as usual without any problems.
Similiar issue happens when I trying to add new admin account on setup.php page
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
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."
";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,}
Last edit: Masao Hattori 2019-12-08
Is this - https://github.com/postfixadmin/postfixadmin/commit/c65a99ce2d3800900fa9ca4b22f02ef955df3096 - good enough ?
thanks!