I have been using Oracle in my company. At home, the machine configuration is too bad, so I plan to use MySQL.
Installation, database creation, and table creation are all good. However, when data is inserted, the English language is correct.
Data Too long for column 'sname' at Row 1I checked the cause on the Internet. It turned out to be a character set problem. The modification method is as follows: (1) modify my. ini (MySQL server instance configuration file) under the MySQL installation directory ). Set default-character-set = GBK (Note: there are 2 places)
(2) modify the database under the corresponding database directory in the data directory. opt configuration file default-character-set = GBK default-collation = gbk_chinese_ci restart the database, close the console window and log on to the database again, execute SQL, everything is normal, and use JSP to connect again, no garbled characters. OK!