Install MySql in Ubuntu server 11.04

Source: Internet
Author: User

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.

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.