Mysql_check fails with an error: mysqlcheck: Got error: 1064

Created:

2017-06-28 10:51:06 UTC

Modified:

2017-08-16 16:55:06 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Mysql_check fails with an error: mysqlcheck: Got error: 1064

Applicable to:

  • Plesk for Linux

Symptoms

MySQL check command fails with an error:

# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqlcheck --all-databases  -u admin
mysqlcheck: Got error: 1064: 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 '.`06`.`2017`' at line 1 when executing 'CHECK TABLE ... '

MySQL folder contains manual copies of database folders:

# ll /var/lib/mysql/ | grep database*
drwx------ 2 mysql mysql 4096 Jan 20 16:05 database_db
drwx------ 2 mysql mysql 4096 May 30 2016 database_db20160530
drwx------ 2 mysql mysql 4096 Jun 23 2016 database_prod
drwx------ 2 mysql mysql 4096 Mar 13 17:40 database_v2

and table copies inside databases like:

# ll /var/lib/mysql/database_db | grep table*
-rw-rw---- 1 mysql mysql 13560 Nov 14 2016 immobiliare.frm
-rw-rw---- 1 mysql mysql 66900 Nov 14 2016 immobiliare.MYD
-rw-rw---- 1 mysql mysql 2048 Nov 14 2016 immobiliare.MYI
-rw-rw---- 1 mysql mysql 13560 Nov 14 2016 immobiliare_14@002e11@002e2016.frm
-rw-rw---- 1 mysql mysql 66900 Nov 14 2016 immobiliare_14@002e11@002e2016.MYD
-rw-rw---- 1 mysql mysql 2048 Nov 14 2016 immobiliare_14@002e11@002e2016.MYI

Cause

MySQL is not designed to work with manual DB/tables copies.

Resolution

Connect to the server using SSH and move/remove all the unused tables and databases backups from /var/lib/mysql/

Have more questions? Submit a request
Please sign in to leave a comment.