It took one day to manually install the MySQL database and the Chinese solution. MySQL 5.0.27 icc was successfully installed on Debian Etch Linux, and the Chinese language was successfully tested using JDBC!
The key to the Chinese problem is that all uses UTF-8 encoding, MySQL 5 release supports UTF-8, but the default is latin1, Java uses all Unicode internally, so ensure that the JSP page is encoded in UTF-8, the JDBC driver adopts the official Connector4J 5.0.4, and the Chinese language is normal in the Resin 3.1/Spring 2.0/Hibernate 3.2 environment.
◆ 1. Download "mysql-standard-5.0.27-linux-i686-icc-glibc23.tar.gz", recommended ICC version, said to be 10-20% better than GCC performance
◆ 2. copy to/usr/local/, unzip: tar zxvf mysql-standard-5.x....tar.gz
◆ 3. add users and groups for mysql:
Groupadd mysql
Useradd-g mysql
◆ 4. create symbolic connections:/usr/local # ln-s mysql-standard-5.x...
◆ 5. cd mysql. change the current directory to/usr/local/mysql/
◆ 6. run the script to initialize the database:./scripts/mysql_install_db -- user = mysqle
◆ 7. set permissions:
/Usr/local/mysql # chown-R root.
/Usr/local/mysql # chown-R mysql data
/Usr/local/mysql # chgrp-R mysql
◆ 8. create and modify/etc/my. cnf as needed. refer to the configuration:
[Mysqld]
# Set the default value to the INNODB table and support transactions:
Default-storage-engine = INNODB
# Set the default character set UTF-8:
Character-set-server = utf8
Collation-server = utf8_general_ci
Default-character-set = utf8
# Disable bdb:
Skip-bdb
◆ 9. start MySQL:
/Usr/local/mysql/bin #./mysqld_safe -- user = mysql &
◆ 10. initialize the root password:
/Usr/local/mysql/bin #./mysqladmin-u root-p password "password-of-root"
Enter password: <输入旧口令,直接按enter designtimesp="29135">
◆ 11. log on to the root account to create a database:
/Usr/local/mysql #./mysql-u root-p
Enter password: password-of-root
◆ 12. create a new user:
Mysql> create user test identified by 'test-password ';
◆ 13. create a new database:
Mysql> create database testdb default character set utf8 default collate utf8_general_ci;
Be sure to specify the character set and sort method, both UTF-8, to ensure that the created table also uses the UTF-8.
◆ 14. Grant the test user the permission to access testdb from localhost and use the password:
Mysql> grant all on testdb. * to test @ localhost identified by 'test-password ';
Note: to remotely connect to MySQL using JDBC, you must set the test user permission correctly. the MySQL access permission consists of the user name, client machine name, and password, in the preceding example, only the test user is allowed to connect to MySQL through a password on the local machine (localhost.
◆ 15. stop the MySQL server:
/Usr/local/mysql/bin #./mysqladmin-u root-p shutdown
Enter password: password-of-root
STOPPING server from pid file/usr/local/mysql/data/debian. pid
Xxx mysqld ended
Chinese cheats: eUD China tutorial online
All encoding-related settings in/etc/my. cnf should be set to UTF-8, refer to Step 8.
Perform the following steps:
Mysql> status;
Note that the characterset values must be UTF-8. otherwise, modify/etc/my. cnf. refer to Step 8.
Mysql> show variables like '% char % ';
Except character_set_filesystem is displayed as binary, all others should be displayed as utf8. if not, modify/etc/my. cnf. refer to Step 8.
Mysql> show variables like '% collation % ';
The display should all be utf8_general_ci. otherwise, modify/etc/my. cnf. refer to Step 8.
Mysqlshow-u root-p-I database-name
Role: Display the database details, if you do not see utf8_general_ci, but latin_swedish_ci, indicating that the database code is not UTF-8, Chinese is certainly not normal, delete it, and then refer to Step 13 to re-create a database in UTF-8