major / MySQLTuner-perl

MySQLTuner is a script written in Perl that will assist you with your MySQL configuration and make recommendations for increased performance and stability.
GNU General Public License v3.0
8.79k stars 1.27k forks source link

Databases with weird character names break queries #617

Open Znuff opened 1 year ago

Znuff commented 1 year ago

As per title, one of my users has a database called: dragon_Ul)e@k!#dERs$_OLD.

This in turn breaks MySQL Tuner:

-------- Storage Engine Statistics -----------------------------------------------------------------
[--] Status: +Aria +CSV +InnoDB +MEMORY +MRG_MyISAM +MyISAM +PERFORMANCE_SCHEMA +SEQUENCE
[--] Data in MyISAM tables: 18.1G (Tables: 27599)
[--] Data in InnoDB tables: 18.4G (Tables: 52391)
[--] Data in MEMORY tables: 0B (Tables: 250)
[OK] Total fragmented tables: 0
[!!] Failed to execute: SHOW TABLE STATUS FROM \`dragon_Ul)e@k!#dERs$_OLD\`
[!!] FAIL Execute SQL / return code: 256
jmrenouard commented 1 year ago

Hi @Znuff Nice name for a database

I try to find what going wrong with that !

Znuff commented 1 year ago

Well, the DB name seems to actually be valid.

I know, I couldn't believe it myself.

Yes, it's a terrible name.

jmrenouard commented 1 year ago

hi @Znuff Can you send me a show create database result ?

Znuff commented 1 year ago

Sure:

MariaDB [(none)]> show create database `dragon_Ul)e@k!#dERs$_OLD` \G
*************************** 1. row ***************************
       Database: dragonpc_Ul)e@k!#dERs$_OLD
Create Database: CREATE DATABASE `dragon_Ul)e@k!#dERs$_OLD` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci */
1 row in set (0.000 sec)
Znuff commented 7 months ago

Still happening with mysqltuner 2.5.0 (same DB).