我用的是jdbc连接mysql,出现这样的问题怎么解决,急,谢谢。
我用的是jdbc连接mysql,出现这样的问题怎么解决方法如下:
1、在建立数据库的时候指定数据库的字符集编码这样这个数据库的所有表都会默认使用数。
2、据库的字符集编码如 create database foo charset utf8。
3、在建表的时候指定字符集编码如 create table foo (id char(20)) charset utf8。
4、指定某一列使用的字符集编码如create table foo (id char(20) charset utf8。
改为test以后运行就出现You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'use (id int(20), name varchar(50),password varchar(50))' at line 1,这样的错误,继续请教。