Ubuntu: 11.04
MySQL: mysql-5.5.17-linux2.6-i686.tar.gz
Shell> sudo groupadd MySQL
Shell> sudo useradd-r-g MySQL
Shell> sudo CD/usr/local
Shell> sudo tar zxvf/path/to/mysql-5.5.17-linux2.6-i686.tar.gz
Shell & gt; sudo ln-s mysql-5.5.17-linux2.6-i686 MySQL
Shell> sudo CD MySQL
Shell> sudo chown-r MySQL.
Shell> sudo chgrp-r MySQL.
Shell> sudo scripts/mysql_install_db -- user = MySQL
If you are prompted to run this command
./Bin/mysqld: Error while loading shared libraries: libaio. so.1: cannot open shared object file: no such file or directory
Install the libaio. So software package.
Shell> sudo chown-r root.
Shell> sudo chown-r Mysql Data
# Next command is optional
Shell> sudo CP support-files/my-medium.cnf/etc/My. CNF
Shell> sudo bin/mysqld_safe -- user = MySQL &
# Next command is optional
Shell> sudo CP support-files/MySQL. Server/etc/init. d/MySQL
MySQL has been installed.
(1) now the command line cannot use MySQL. You need to add the path
Shell> sudo VI/etc/environment
Add path:/usr/local/MySQL/bin
(2) Currently, MySQL cannot be started with the system. Do not run the following command:
Update-rc.d MySQL ults
(3) Chinese garbled characters
Shell> sudo VI/etc/My. CNF
Add under [client]
Default-character-set = utf8
Add under [mysqld]
Character_set_server = utf8
In this way, it is normal to insert and query Chinese characters through the program.
However, the command line is used to input Chinese characters, which are not garbled characters and are indeed empty characters.
Solution:
After logging on to the database, call set names GBK first, and then insert basic statements such as query continuously.