How to compile and install mysql5.1 database in Centos6

Source: Internet
Author: User

I. Mysql introduction

MySQL is an open-source small-scale associated database management system. The developer is MySQL AB in Sweden. MySQL is widely used in small and medium websites on the Internet. Because of its small size, fast speed, and low total cost of ownership, especially the open source code, many small and medium websites have chosen MySQL as their website database to reduce their total cost of ownership.

II. Installation and configuration

1. Download the mysql5.1 file

Wget http://cdn.mysql.com/Downloads/MySQL-5.1/mysql-5.1.72.tar.gz
2. Add mysql-Related Users and Groups

Groupadd mysql
Useradd-g mysql
3. Unzip the installation package

Tar-zxvf mysql-5.1.72.tar.gz
4. Compile parameters

./Configure -- prefix =/usr/local/mysql/-- with-extra-charsets = big5, ascii, gb2312, gbk, utf8, latin1 -- with-mysqld-user = mysql
// You can adjust the compilation parameters by yourself./configure -- help to view the compiled parameter options, or view the installed compilation parameters.
5. Compile and install

Make & make install
6. Copy the configuration file

Cp support-files/my-medium.cnf/etc/my. cnf // Copy my. cnf configuration file
Cp support-files/mysql. server/etc/init. d/mysqld // Copy and start the mysqld file
7. Set permissions

Cd/usr/local/mysql
Chown-R mysql. mysql.
8. Create a table allowed by Mysql

/Usr/local/mysql/bin/mysql_install_db -- user = mysql
9. Set mysql startup

Chmod a + x/etc/init. d/mysqld
Chkconfig mysqld on
10. Set the mysql root password

Service mysqld start
/Usr/local/mysql/bin/mysqladmin-uroot password 'password'
11. mysql is successfully installed and mysql software can be used normally.

III. Installation problems:

Question 1:
Error in./configure: error: No curses/termcap library found?
Solution:

Yum-y install ncurses-devel
Then re-compile./configure

Tip 1:
The above/usr/local/mysql is just my installation path and can be replaced

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.