mysqlodbcasteriskunixodbcpbx

Asterisk, Mysql, Odbc (Unknown column 'data' in 'field list')


I use Asterisk 16.5.0, Mysql 5.7.28 and MySQL ODBC 8.0 Unicode Driver. I configured connection with MySql via ODBC connection. After some time Asterisk shows warning like that.

[2019-12-11 15:34:06] WARNING[1995]: res_odbc.c:538 ast_odbc_print_errors: SQL Prepare returned an error: 42S22: [MySQL][ODBC 8.0(w) Driver][mysqld-5.7.28-log]Unknown column 'data' in 'field list'
[2019-12-11 15:34:06] WARNING[1995]: res_config_odbc.c:122 custom_prepare: SQL Prepare failed! [INSERT INTO queue_log (time, data, event, agent, queuename, callid) VALUES (?, ?, ?, ?, ?, ?)]

After restarting Asterisk, the problem does not occur. But after some time problem begins occur.


Solution

  • I found the problem. Problem is that mysql starts before asterisk start. After some versions of Mysql service name renamed from mysql to mysqld. Because in startup script Asterisk (location on Centos is /etc/init.d/asterisk) we must change also.

    # Should-Start:      dahdi misdn lcr wanrouter mysql postgresql
    

    change to

    # Should-Start:      dahdi misdn lcr wanrouter mysqld postgresql