Current location - Training Enrollment Network - Books and materials - Using JSP to insert a book information into the database, what is the question mark that shows all Chinese characters after insertion?
Using JSP to insert a book information into the database, what is the question mark that shows all Chinese characters after insertion?
Check and modify the configuration file of mysql's my.ini

Default Character Set =utf8

The database was created to specify a character set.

Create default character set utf8 of database mydb and proofread utf8_general_ci

To create a data representation, you also need to specify a character set:

Wrong command:

If it does not exist, create a table mydb (

Username' varchar(64) is not empty.

Userid' int( 1 1) is not empty.

)ENGINE = InnoDB DEFAULT CHARSET = Latin 1;

Correct command:

If it does not exist, create a table mydb (

Username' varchar(64) is not empty.

Userid' int( 1 1) is not empty.

)ENGINE = InnoDB DEFAULT CHARSET = utf8;