Error creating temporary table Mysql Php Pdo (mysql.column_stats: expected column 'max_value' ...)

0

I have an extensive procedure that runs directly in mysql works, now when I put it in php I get an error from the beginning that is creating a temporary table from where I will be getting data for the remainder of the report. This is the code that I try and when I execute it returns OK because the $ stmt - > execute () is running but the table is not created.

   $stmt = Conexion::Conectar()->prepare("CREATE TEMPORARY TABLE 
        resultado_subdeterminante_temporal 
        (id int, idSubDeterminante int, posibles int, positivas 
        int)");

        if($stmt -> execute()){
           echo 'OK';
        } else {
           echo 'ERROR';
        }
        $stmt = null;

These are the Log MySql

2018-11-29 17:38:31 18908 [ERROR] Incorrect definition of table 
mysql.column_stats: expected column 'min_value' at position 3 to have type 
varbinary(255), found type varchar(255).

2018-11-29 17:38:31 18908 [ERROR] Incorrect definition of table 
mysql.column_stats: expected column 'max_value' at position 4 to have type 
varbinary(255), found type varchar(255).

Now if I take that query and execute it in mysql or phpmyadmin the table is created ok:

        CREATE TEMPORARY TABLE 
        resultado_subdeterminante_temporal 
        (id int, idSubDeterminante int, posibles int, positivas 
        int)

I do not understand the error, what are the errors of the log?

    
asked by Juan 29.11.2018 в 21:46
source

1 answer

0

SOLUTION

Fix it by upgrading MySql.

-> Entrar a CMD
-> Navegar hasta llegar a la carpeta xampp/mysql/bin/
-> Ejecutar el comando mysql_upgrade -uroot -p
-> Completar password de la base
-> Se upgradea MySql
-> El procedimiento ya funciona

Source: link

    
answered by 30.11.2018 / 17:23
source