Question marks in mysql
I try to insert data from mssql to my sql, all data in English transfer good, but the data in Hebrew开发者_如何学C insert to mysql like Question marks. what I need to do? shiri
The question mark means that MySQL cannot convert the information you entered into a valid character in the character encoding of the column. Note that the column encoding may be inherited from the table, and the table encoding from the database.
You should check what encoding the database/table/column is using, and if necessary change it to an encoding that supports Hebrew. The encoding 'utf-8' is a good choice, because it supports everything :)
To determine the encoding of your database, table and all columns from the MySQL command line:
USE your_database_name;
SHOW VARIABLES LIKE "character\_set\_database";
SHOW CREATE TABLE your_table_name;
Change the encoding of your database, table or column to utf-8:
ALTER DATABASE your_database_name charset=utf8;
ALTER TABLE your_table_name charset=utf8;
ALTER TABLE your_table_name ALTER COLUMN your_column_name charset=utf8;
From then on, run the MySQL command line with the following option to ensure your input is in utf-8:
mysql --default-character-set=utf8
And try again importing your data (good luck!). If you still have problems you should edit your question and post some more information about the current encodings of the databases and tables in both MSSQL and MySQL.
精彩评论