This article mainly describes the manual Installation Method of MySQL and the actual operation solution of the Chinese language. I spent one day successfully installing MySQL 5.0.27 icc On Debian Etch Linux, after the installation is complete, use JDBC to test Chinese!
The key to the Chinese problem is that all uses UTF-8 encoding, MySQL (the best combination with PHP) 5 release supports UTF-8, but the default is latin1, Java uses Unicode internally, therefore, ensure that the jsp (SUN Enterprise Application's preferred) page is coded in UTF-8, The JDBC driver uses the official Connector4J 5.0.4, in resin (a free JSP running platform) in the 3.1/Spring 2.0/Hibernate 3.2 Environment, Chinese characters are tested normally.
1. Download "mysql()and php )))))-standard-5.0.27-linux-i686-icc-glibc23.tar.gz", and recommend the ICC version, which is said to improve the GCC performance by 10-20%
2. Copy to/usr/local/and decompress the file: tar zxvf mysql(and php ))))-standard-5.x...tar.gz
3. Add users and groups of MySQL (the best combination with PHP ):
Groupadd MySQL (best combination with PHP)
Useradd-g MySQL (the best combination with PHP)
4. Create a symbolic connection:/usr/local # ln-s MySQL (best combination with PHP)-standard-5.x... MySQL (best combination with PHP)
5. cd MySQL (the best combination with PHP). Change the current directory to/usr/local/MySQL (the best combination with PHP )/
6. Run the script to initialize the database:./scripts/MySQL (the best combination with PHP) _ install_db -- user = MySQL (the best combination with PHP)
7. MySQL manual installation method to set permissions:
/Usr/local/MySQL (the best combination with PHP) # chown-R root.
/Usr/local/MySQL (the best combination with PHP) # chown-R MySQL (the best combination with PHP) data
/Usr/local/MySQL (the best combination with PHP) # chgrp-R MySQL (the best combination with PHP)
8. Create and modify/etc/my. cnf as needed. Refer to the Configuration:
[MySQL (the best combination with PHP) d]
# 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 (the best combination with PHP ):
/Usr/local/MySQL (the best combination with PHP)/bin #. /MySQL (the best combination with PHP) d_safe -- user = MySQL (the best combination with PHP )&
10. initialize the root password:
/Usr/local/MySQL (the best combination with PHP)/bin #. /MySQL (the best combination with PHP) admin-u root-p password "password-of-root"
Enter password: <Enter the old password and press Enter>
11. log on to the root account to create a database:
/Usr/local/MySQL (the best combination with PHP) #./MySQL (the best combination with PHP)-u root-p
Enter password: password-of-root
12. Create a new user using the MySQL manual installation method:
MySQL (best combination with PHP)> create user test identified by 'test-password ';
13. Create a new database:
MySQL (best combination with PHP)> create database testdb default character set utf8 default collate utf8_general_ci;
The above content is a description of the MySQL manual installation method and the Chinese solution. I hope it will help you in this regard.