Compile and install MySQL 11.04 in Ubuntu 5.5 (32-bit) Environment

Source: Internet
Author: User

We have already installed Ubuntu 11.04. We found that apt-get can only install MySQL 5.1. If you want to use MySQL 5.5, you can only compile it by yourself.
The compilation and installation process records are as follows:

1. Go to mysql.com to download the source code of MySQL 5.5.15:
Mysql-5.5.15.tar.gz (Generic Linux (Architecture Independent ))

2. install necessary software:
1. cmake
~ $ Sudo apt-get install cmake
 
2. bison
~ $ Sudo apt-get install bison

3. Add user groups and user names to the MySQL server
~ $ Sudo groupadd mysql
~ $ Sudo useradd-r-g mysql

4. decompress the downloaded source code (in the download path ~ /Src for example), compile and install:
~ $ Cd src
~ /Src $ tar-xzf mysql-5.5.15.tar.gz
~ /Src $ cd mysql-5.5.15
~ /Src/mysql-5.5.15 $ cmake.
~ /Src/mysql-5.5.15 $ make
~ /Src/mysql-5.5.15 $ sudo make install

If no error is reported for the preceding commands, the compilation and installation are successful. The default value is/usr/local/mysql.
Run the following command to complete the installation:
~ /Src/mysql-5.5.15 $ cd/usr/local
/Usr/local $ sudo chown-R mysql. mysql
/Usr/local $ sudo ln-s/usr/local/mysql/bin/*/usr/bin
/Usr/local $ sudo ln-s/usr/local/mysql/share/usr/share/mysql

If you want to use MySQL for secondary development:
/Usr/local $ sudo ln-s/usr/local/mysql/include/usr/include/mysql
/Usr/local $ sudo ln-s/usr/local/mysql/lib/*/usr/lib/

Return to the initial path and run:
~ $ Mysql -- version
Mysql Ver 14.14 Distrib 5.5.15, for Linux (i686) using EditLine wrapper
It indicates that the mysql client is ready for use.

5. Configure MySQL Server:
~ $ Sudo install-m644/usr/local/mysql/support-files/my-medium.cnf/etc/my. cnf
(Note: Select my-medium.cnf or my-large.cnf, my-huge.cnf according to actual needs)
~ $ Sudo/usr/local/mysql/scripts/mysql_install_db -- user = mysql -- datadir =/var/lib/mysql

~ $ Sudo install-m755/usr/local/mysql/support-files/mysql. server/etc/init. d/mysqld

Edit/etc/my. cnf, add datadir =/var/lib/mysql under [mysqld], and then start MySQL server:
~ $ Sudo/etc/init. d/mysqld start

If the preceding command does not return an error, it indicates that the MySQL 5.5.15 server has been installed successfully. Set the root password first:
~ $ Mysqladmin-u root password <root-password>
~ $ Mysql-u root-p

Modify/etc/my. cnf to complete further configuration.

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.