java.sql.BatchUpdateException: Incorrect string value: '\xE6\x96\x87\xE7\xAB\xA0...' for column 'title' at row 1
at com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPreparedStatement.java:647)
at db_mysql.InertDataBase.main(InertDataBase.java:200)
mysql> SHOW CREATE DATABASE mysql;
+----------+------------------------------------------------------------------+
| Database | Create Database |
+----------+------------------------------------------------------------------+
| mysql | CREATE DATABASE `mysql` !40100 DEFAULT CHARACTER SET latin1 |
+----------+------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> SHOW CREATE TABLE news;
+-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
| news | CREATE TABLE `news` (
`title` text NOT NULL,
`content` text NOT NULL,
`type` text NOT NULL,
`id` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
+-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> ALTER DATABASE mysql DEFAULT CHARACTER SET utf8;
Query OK, 1 row affected (0.00 sec)
mysql> ALTER TABLE mysql.news CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
Query OK, 0 rows affected (0.04 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> commit;
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql>