Open mrbraca15 opened 7 years ago
Um, good question. MySQL has like half a dozen different places to set the character set; we should be setting them correctly when we can, but it's possible your server or connection has a goofy setting.
What does SHOW VARIABLES LIKE 'character_set%';
produce?
produce this
Variable_name Value
character_set_client utf8
character_set_connection utf8
character_set_database utf8
character_set_filesystem binary
character_set_results utf8
character_set_server latin1
character_set_system utf8
character_sets_dir C:\xampp\mysql\share\charsets\
I found the solution for this problem, adding a charset variable in your SQLAlchemy connection.
Example: pokedex load -e mysql+pymysql://admin:password@localhost/database?charset=utf8
Regards
If anyone has this issue and the above comments didn't solve it, here are the steps I just used to solve it. Enter the mysql terminal and enter:
SELECT default_character_set_name FROM information_schema.SCHEMATA S WHERE schema_name = "DBNAME";
Change DBNAME
to the database name you had created.
This was my output:
+----------------------------+
| default_character_set_name |
+----------------------------+
| latin1 |
+----------------------------+
1 row in set (0.00 sec)
Now enter this command changing DBNAME
to your database name again:
ALTER DATABASE DBNAME CHARACTER SET utf8 COLLATE utf8_general_ci;
After I did that I was able to load using
pokedex load -e mysql+pymysql://admin:password@localhost/database
hello people, I could load the data on mysql database with the following command pokedex load -e mysql+mysqldb://root@localhost/databasename, but there are tables like move_names that contains register with strange characters,¿how can I load the data with the correct character set? I need the data in english and spanish too.