桌子:
CREATE TABLE test (test VARCHAR(10));
test.sql
:
INSERT INTO test VALUES ('тест');
在 bash 中:
$ mysql --version
mysql Ver 14.14 Distrib 5.5.31, for debian-linux-gnu (x86_64) using readline 6.2
$ file -bi test.sql
text/plain; charset=utf-8
$ mysql --database=... --user=... -p --default-character-set=utf8 < test.sql
结果到
mysql> select * from test;
+------+
| test |
+------+
| ???? |
+------+
如何test.sql
正确执行?