When I import a sql file from a server I get strange characters. I want to believe it's encoding. I am writing the values of the server bd and the local bd:
SERVER:
collation_connection: utf8mb4_general_ci
collation_database: utf8_spanish_ci
collation_server: utf8_general_ci
character_set_client: utf8mb4
character_set_connection: utf8mb4
character_set_database: utf8
character_set_filesystem: binary
character_set_results: utf8mb4
character_set_server: utf8
character_set_system: utf8
character_sets_dir: C:\Program Files\MySQL\MySQL Server 5.7\share\charsets\
LOCAL
collation_connection: utf8mb4_general_ci
collation_database: latin1_swedish_ci
collation_server: latin1_swedish_ci
character_set_client: utf8mb4
character_set_connection: utf8mb4
character_set_database: latin1
character_set_filesystem: binary
character_set_results: utf8mb4
character_set_server: latin1
character_set_system: utf8
character_sets_dir: C:\xampp\mysql\share\charsets\
File SQL import contains this script:
CREATE DATABASE IF NOT EXISTS `prueba` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_spanish_ci */;
USE `prueba`;
CREATE TABLE IF NOT EXISTS `pruebaTable` (
`co_pruebaTable` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) COLLATE utf8_spanish_ci NOT NULL
PRIMARY KEY (`co_pruebaTable`)
) ENGINE=InnoDB AUTO_INCREMENT=418630 DEFAULT CHARSET=utf8
COLLATE=utf8_spanish_ci;
When I import database in my local, column "name" in "pruebaTable" contains rare characters but in server database i see this data correctly
I have tried to change this variables with this queries, but it do not work:
set collation_database=utf8_spanish_ci;
What can be the solution? I need see this data correctly when i import this file sql. I open this file with notepad++ and i can see data correctly. The codification .sql is: UTF-8, so the problem should be encoding to local database, i think
Thanks