MySQL Syntax Error

5 posts / 0 new
Last post
w9as
MySQL Syntax Error

Good Day!

Thanks for such awesome Linux software. I am having my first major issue after many years of use and am requesting your assistance to get my DB back in use. When I go to the QSO List window, I get the following error message:

"TMySQL57Connection : Error executing 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 '))) as foo' at line 1."

I am currently on Linux Mint 19, CQRLOG 2.3.0, and MySQL 5.7.22-0ubuntu18.04.1

Below is the output from the SQL error log (pardon the length):

2018-07-13T05:10:05.934454Z 0 [Warning] The syntax '--log_warnings/-W' is deprecated and will be removed in a future release. Please use '--log_error_verbosity' instead.
2018-07-13T05:10:05.934535Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-07-13T05:10:05.936994Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.22-0ubuntu18.04.1) starting as process 14872 ...
2018-07-13T05:10:05.940842Z 0 [Note] InnoDB: PUNCH HOLE support available
2018-07-13T05:10:05.940891Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-07-13T05:10:05.940901Z 0 [Note] InnoDB: Uses event mutexes
2018-07-13T05:10:05.940909Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-07-13T05:10:05.940918Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2018-07-13T05:10:05.940927Z 0 [Note] InnoDB: Using Linux native AIO
2018-07-13T05:10:05.941292Z 0 [Note] InnoDB: Number of pools: 1
2018-07-13T05:10:05.941424Z 0 [Note] InnoDB: Not using CPU crc32 instructions
2018-07-13T05:10:05.943458Z 0 [Note] InnoDB: Initializing buffer pool, total size = 80M, instances = 1, chunk size = 80M
2018-07-13T05:10:05.951273Z 0 [Note] InnoDB: Completed initialization of buffer pool
2018-07-13T05:10:05.953561Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2018-07-13T05:10:05.966133Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2018-07-13T05:10:06.000508Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2018-07-13T05:10:06.000653Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2018-07-13T05:10:06.196454Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2018-07-13T05:10:06.197566Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2018-07-13T05:10:06.197608Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2018-07-13T05:10:06.198236Z 0 [Note] InnoDB: 5.7.22 started; log sequence number 2870526
2018-07-13T05:10:06.198384Z 0 [Note] InnoDB: Loading buffer pool(s) from /home/darren/.config/cqrlog/database/ib_buffer_pool
2018-07-13T05:10:06.198720Z 0 [Note] Plugin 'FEDERATED' is disabled.
2018-07-13T05:10:06.199239Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2018-07-13T05:10:06.199331Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2018-07-13T05:10:06.199344Z 0 [Note] Server hostname (bind-address): '*'; port: 64000
2018-07-13T05:10:06.199384Z 0 [Note] IPv6 is available.
2018-07-13T05:10:06.199393Z 0 [Note] - '::' resolves to '::';
2018-07-13T05:10:06.199434Z 0 [Note] Server socket created on IP: '::'.
2018-07-13T05:10:06.201043Z 0 [Note] InnoDB: Buffer pool(s) load completed at 180713 0:10:06
2018-07-13T05:10:06.222130Z 0 [Warning] Failed to open optimizer cost constant tables

2018-07-13T05:10:06.222297Z 0 [Warning] Can't open and lock time zone table: Table 'mysql.time_zone_leap_second' doesn't exist trying to live without them
2018-07-13T05:10:06.222358Z 0 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
2018-07-13T05:10:06.222449Z 0 [ERROR] Native table 'performance_schema'.'cond_instances' has the wrong structure
2018-07-13T05:10:06.222474Z 0 [ERROR] Native table 'performance_schema'.'events_waits_current' has the wrong structure
2018-07-13T05:10:06.222498Z 0 [ERROR] Native table 'performance_schema'.'events_waits_history' has the wrong structure
2018-07-13T05:10:06.222522Z 0 [ERROR] Native table 'performance_schema'.'events_waits_history_long' has the wrong structure
2018-07-13T05:10:06.222548Z 0 [ERROR] Native table 'performance_schema'.'events_waits_summary_by_host_by_event_name' has the wrong structure
2018-07-13T05:10:06.222572Z 0 [ERROR] Native table 'performance_schema'.'events_waits_summary_by_instance' has the wrong structure
2018-07-13T05:10:06.222597Z 0 [ERROR] Native table 'performance_schema'.'events_waits_summary_by_thread_by_event_name' has the wrong structure
2018-07-13T05:10:06.222622Z 0 [ERROR] Native table 'performance_schema'.'events_waits_summary_by_user_by_event_name' has the wrong structure
2018-07-13T05:10:06.222647Z 0 [ERROR] Native table 'performance_schema'.'events_waits_summary_by_account_by_event_name' has the wrong structure
2018-07-13T05:10:06.222672Z 0 [ERROR] Native table 'performance_schema'.'events_waits_summary_global_by_event_name' has the wrong structure
2018-07-13T05:10:06.222696Z 0 [ERROR] Native table 'performance_schema'.'file_instances' has the wrong structure
2018-07-13T05:10:06.222720Z 0 [ERROR] Native table 'performance_schema'.'file_summary_by_event_name' has the wrong structure
2018-07-13T05:10:06.222744Z 0 [ERROR] Native table 'performance_schema'.'file_summary_by_instance' has the wrong structure
2018-07-13T05:10:06.222768Z 0 [ERROR] Native table 'performance_schema'.'host_cache' has the wrong structure
2018-07-13T05:10:06.222792Z 0 [ERROR] Native table 'performance_schema'.'mutex_instances' has the wrong structure
2018-07-13T05:10:06.222816Z 0 [ERROR] Native table 'performance_schema'.'objects_summary_global_by_type' has the wrong structure
2018-07-13T05:10:06.222848Z 0 [ERROR] Native table 'performance_schema'.'performance_timers' has the wrong structure
2018-07-13T05:10:06.222871Z 0 [ERROR] Native table 'performance_schema'.'rwlock_instances' has the wrong structure
2018-07-13T05:10:06.222895Z 0 [ERROR] Native table 'performance_schema'.'setup_actors' has the wrong structure
2018-07-13T05:10:06.222919Z 0 [ERROR] Native table 'performance_schema'.'setup_consumers' has the wrong structure
2018-07-13T05:10:06.222942Z 0 [ERROR] Native table 'performance_schema'.'setup_instruments' has the wrong structure
2018-07-13T05:10:06.222965Z 0 [ERROR] Native table 'performance_schema'.'setup_objects' has the wrong structure
2018-07-13T05:10:06.222988Z 0 [ERROR] Native table 'performance_schema'.'setup_timers' has the wrong structure
2018-07-13T05:10:06.223014Z 0 [ERROR] Native table 'performance_schema'.'table_io_waits_summary_by_index_usage' has the wrong structure
2018-07-13T05:10:06.223038Z 0 [ERROR] Native table 'performance_schema'.'table_io_waits_summary_by_table' has the wrong structure
2018-07-13T05:10:06.223062Z 0 [ERROR] Native table 'performance_schema'.'table_lock_waits_summary_by_table' has the wrong structure
2018-07-13T05:10:06.223085Z 0 [ERROR] Native table 'performance_schema'.'threads' has the wrong structure
2018-07-13T05:10:06.223108Z 0 [ERROR] Native table 'performance_schema'.'events_stages_current' has the wrong structure
2018-07-13T05:10:06.223132Z 0 [ERROR] Native table 'performance_schema'.'events_stages_history' has the wrong structure
2018-07-13T05:10:06.223155Z 0 [ERROR] Native table 'performance_schema'.'events_stages_history_long' has the wrong structure
2018-07-13T05:10:06.223180Z 0 [ERROR] Native table 'performance_schema'.'events_stages_summary_by_thread_by_event_name' has the wrong structure
2018-07-13T05:10:06.223205Z 0 [ERROR] Native table 'performance_schema'.'events_stages_summary_by_account_by_event_name' has the wrong structure
2018-07-13T05:10:06.223230Z 0 [ERROR] Native table 'performance_schema'.'events_stages_summary_by_user_by_event_name' has the wrong structure
2018-07-13T05:10:06.223254Z 0 [ERROR] Native table 'performance_schema'.'events_stages_summary_by_host_by_event_name' has the wrong structure
2018-07-13T05:10:06.223279Z 0 [ERROR] Native table 'performance_schema'.'events_stages_summary_global_by_event_name' has the wrong structure
2018-07-13T05:10:06.223316Z 0 [ERROR] Native table 'performance_schema'.'events_statements_current' has the wrong structure
2018-07-13T05:10:06.223339Z 0 [ERROR] Native table 'performance_schema'.'events_statements_history' has the wrong structure
2018-07-13T05:10:06.223363Z 0 [ERROR] Native table 'performance_schema'.'events_statements_history_long' has the wrong structure
2018-07-13T05:10:06.223388Z 0 [ERROR] Native table 'performance_schema'.'events_statements_summary_by_thread_by_event_name' has the wrong structure
2018-07-13T05:10:06.223414Z 0 [ERROR] Native table 'performance_schema'.'events_statements_summary_by_account_by_event_name' has the wrong structure
2018-07-13T05:10:06.223438Z 0 [ERROR] Native table 'performance_schema'.'events_statements_summary_by_user_by_event_name' has the wrong structure
2018-07-13T05:10:06.223463Z 0 [ERROR] Native table 'performance_schema'.'events_statements_summary_by_host_by_event_name' has the wrong structure
2018-07-13T05:10:06.223488Z 0 [ERROR] Native table 'performance_schema'.'events_statements_summary_global_by_event_name' has the wrong structure
2018-07-13T05:10:06.223512Z 0 [ERROR] Native table 'performance_schema'.'events_statements_summary_by_digest' has the wrong structure
2018-07-13T05:10:06.223537Z 0 [ERROR] Native table 'performance_schema'.'events_statements_summary_by_program' has the wrong structure
2018-07-13T05:10:06.223560Z 0 [ERROR] Native table 'performance_schema'.'events_transactions_current' has the wrong structure
2018-07-13T05:10:06.223583Z 0 [ERROR] Native table 'performance_schema'.'events_transactions_history' has the wrong structure
2018-07-13T05:10:06.223613Z 0 [ERROR] Native table 'performance_schema'.'events_transactions_history_long' has the wrong structure
2018-07-13T05:10:06.223639Z 0 [ERROR] Native table 'performance_schema'.'events_transactions_summary_by_thread_by_event_name' has the wrong structure
2018-07-13T05:10:06.223664Z 0 [ERROR] Native table 'performance_schema'.'events_transactions_summary_by_account_by_event_name' has the wrong structure
2018-07-13T05:10:06.223690Z 0 [ERROR] Native table 'performance_schema'.'events_transactions_summary_by_user_by_event_name' has the wrong structure
2018-07-13T05:10:06.223715Z 0 [ERROR] Native table 'performance_schema'.'events_transactions_summary_by_host_by_event_name' has the wrong structure
2018-07-13T05:10:06.223741Z 0 [ERROR] Native table 'performance_schema'.'events_transactions_summary_global_by_event_name' has the wrong structure
2018-07-13T05:10:06.223764Z 0 [ERROR] Native table 'performance_schema'.'users' has the wrong structure
2018-07-13T05:10:06.223787Z 0 [ERROR] Native table 'performance_schema'.'accounts' has the wrong structure
2018-07-13T05:10:06.223809Z 0 [ERROR] Native table 'performance_schema'.'hosts' has the wrong structure
2018-07-13T05:10:06.223833Z 0 [ERROR] Native table 'performance_schema'.'socket_instances' has the wrong structure
2018-07-13T05:10:06.223856Z 0 [ERROR] Native table 'performance_schema'.'socket_summary_by_instance' has the wrong structure
2018-07-13T05:10:06.223880Z 0 [ERROR] Native table 'performance_schema'.'socket_summary_by_event_name' has the wrong structure
2018-07-13T05:10:06.223904Z 0 [ERROR] Native table 'performance_schema'.'session_connect_attrs' has the wrong structure
2018-07-13T05:10:06.223928Z 0 [ERROR] Native table 'performance_schema'.'session_account_connect_attrs' has the wrong structure
2018-07-13T05:10:06.223953Z 0 [ERROR] Native table 'performance_schema'.'memory_summary_global_by_event_name' has the wrong structure
2018-07-13T05:10:06.223977Z 0 [ERROR] Native table 'performance_schema'.'memory_summary_by_account_by_event_name' has the wrong structure
2018-07-13T05:10:06.224002Z 0 [ERROR] Native table 'performance_schema'.'memory_summary_by_host_by_event_name' has the wrong structure
2018-07-13T05:10:06.224027Z 0 [ERROR] Native table 'performance_schema'.'memory_summary_by_thread_by_event_name' has the wrong structure
2018-07-13T05:10:06.224051Z 0 [ERROR] Native table 'performance_schema'.'memory_summary_by_user_by_event_name' has the wrong structure
2018-07-13T05:10:06.224074Z 0 [ERROR] Native table 'performance_schema'.'table_handles' has the wrong structure
2018-07-13T05:10:06.224097Z 0 [ERROR] Native table 'performance_schema'.'metadata_locks' has the wrong structure
2018-07-13T05:10:06.224121Z 0 [ERROR] Native table 'performance_schema'.'replication_connection_configuration' has the wrong structure
2018-07-13T05:10:06.224144Z 0 [ERROR] Native table 'performance_schema'.'replication_group_members' has the wrong structure
2018-07-13T05:10:06.224168Z 0 [ERROR] Native table 'performance_schema'.'replication_connection_status' has the wrong structure
2018-07-13T05:10:06.224192Z 0 [ERROR] Native table 'performance_schema'.'replication_applier_configuration' has the wrong structure
2018-07-13T05:10:06.224215Z 0 [ERROR] Native table 'performance_schema'.'replication_applier_status' has the wrong structure
2018-07-13T05:10:06.224240Z 0 [ERROR] Native table 'performance_schema'.'replication_applier_status_by_coordinator' has the wrong structure
2018-07-13T05:10:06.224264Z 0 [ERROR] Native table 'performance_schema'.'replication_applier_status_by_worker' has the wrong structure
2018-07-13T05:10:06.224288Z 0 [ERROR] Native table 'performance_schema'.'replication_group_member_stats' has the wrong structure
2018-07-13T05:10:06.224312Z 0 [ERROR] Native table 'performance_schema'.'prepared_statements_instances' has the wrong structure
2018-07-13T05:10:06.224335Z 0 [ERROR] Native table 'performance_schema'.'user_variables_by_thread' has the wrong structure
2018-07-13T05:10:06.224357Z 0 [ERROR] Native table 'performance_schema'.'status_by_account' has the wrong structure
2018-07-13T05:10:06.224387Z 0 [ERROR] Native table 'performance_schema'.'status_by_host' has the wrong structure
2018-07-13T05:10:06.224410Z 0 [ERROR] Native table 'performance_schema'.'status_by_thread' has the wrong structure
2018-07-13T05:10:06.224433Z 0 [ERROR] Native table 'performance_schema'.'status_by_user' has the wrong structure
2018-07-13T05:10:06.224455Z 0 [ERROR] Native table 'performance_schema'.'global_status' has the wrong structure
2018-07-13T05:10:06.224478Z 0 [ERROR] Native table 'performance_schema'.'session_status' has the wrong structure
2018-07-13T05:10:06.224501Z 0 [ERROR] Native table 'performance_schema'.'variables_by_thread' has the wrong structure
2018-07-13T05:10:06.224523Z 0 [ERROR] Native table 'performance_schema'.'global_variables' has the wrong structure
2018-07-13T05:10:06.224546Z 0 [ERROR] Native table 'performance_schema'.'session_variables' has the wrong structure
2018-07-13T05:10:06.224772Z 0 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.7.22-0ubuntu18.04.1' socket: '/home/darren/.config/cqrlog/database/sock' port: 64000 (Ubuntu)
2018-07-13T05:10:07.843995Z 3 [ERROR] InnoDB: Table `mysql`.`innodb_table_stats` not found.
2018-07-13T05:10:07.844037Z 3 [ERROR] InnoDB: Fetch of persistent statistics requested for table `cqrlog001`.`freqmem` but the required system tables mysql.innodb_table_stats and mysql.innodb_index_stats are not present or have unexpected structure. Using transient stats instead.

oz1gnn
Here are output of Debug=1

Here are output of Debug=1

First time you try to open it thows the above error. Next time it throws a different one. Both are in the file.

File: 

Vy 73 de oz1gnn

w9as
Here is the pertinent output

Here is the pertinent output from my Debug=1:

select * from view_cqrlog_main_by_qsodate LIMIT 500 OFFSET 0

LoadForm: frmMain
SELECT COUNT(*) FROM cqrlog_main

select count(*) from (select distinct adif from cqrlog_main where adif <> 0 and (adif not in ())) as foo

TApplication.HandleException TMySQL57Connection : Error executing 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 '))) as foo' at line 1

oh1kh
See this thread

--
Saku
OH1KH

w9as
Fixed!

The instruction regarding the ctyfiles folder did the trick and all of my QSO's were in the log.

Thanks!

Darren - W9AS