Install Mysql with the source code in RHEL5

Source: Internet
Author: User

Sh # wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.7.tar.gz
Sh # tar-zxvf ncurses-5.7.tar.gz
Sh # cd ncurses-5.7
Sh #./configure -- prefix =/usr/local/ncurses -- with-shared -- without-debug
Sh # make & make install

Sh # wget http://ftp.jaist.ac.jp/pub/mysql/Downloads/MySQL-5.1/mysql-5.1.45.tar.gz
Sh # tar-zxvf mysql-5.1.45.tar.gz
Sh # cd mysql-5.1.45
Sh # groupadd mysql
Sh # useradd-g mysql
Sh #./configure -- prefix =/usr/local/mysql \
-- With-mysqld-user = mysql \
-- Without-debug \
-- With-client-ldflags =-all-static \
-- With-mysqld-ldflags =-all-static \
-- Disable-shared \
-- Localstatedir =/usr/local/mysql/data \
-- With-extra-charsets = none \
-- Enable-Cycler \
-- With-unix-socket-path =/tmp/mysql. socket \
-- With-named-curses-libs =/usr/local/ncurses/lib/libncurses.
Sh # make
Sh # make install
Sh # cp support-files/my-medium.cnf/etc/my. cnf
Sh # cd/usr/local/mysql
Sh # chown-R mysql.
Sh # chgrp-R mysql.
Sh # bin/mysql_install_db -- user = mysql
Sh # chown-R root.
Sh # chown-R mysql data
Sh # bin/mysqld_safe -- user = mysql &
Sh # bin/mysqladmin-u root password 'public' // initialize the password
Sh # cp support-files/mysql. server/etc/init. d/mysqld
Sh # chmod + x/etc/init. d/mysqld
Sh # chkconfig -- add mysqld
Sh # service mysqld restart

Install the latest source code:
Sh # cd/usr/local/src/mysql-5.5.16
Sh # rm-f CMakeCache.txt
Sh #/usr/local/cmake/bin/cmake. \ // cmake in place of configure (the cmake system comes with or install./configure; gmake install). The other steps are the same.
-Dcmake_install_prefix =/usr/local/MySQL \
-Dmysql_datadir =/usr/local/MySQL/data /\
-Dmysql_unix_addr =/tmp/mysqld. Sock \
-Ddefault_charset = utf8 \
-Dextra_charsets = all \
-Ddefault_collation = utf8_general_ci \
-Dwith_myisam_storage_engine = 1 \
-Dwith_innobase_storage_engine = 1 \
-Dwith_partition_storage_engine = 1 \
-Dwith_readline = 1 \
-Denabled_local_infile = 0 \
-Dmysql_tcp_port = 3306
Sh # Make
Sh # make install
...

Common my. CNF configurations:
Skip-external-locking
Tmpdir =/home/tmp
PID-file =/tmp/mysqld. PID
Skip-name-resolve // skip domain name resolution. You can set this option when using IP connection.
# Skip-InnoDB
# Skip-networking
Net_buffer_length = 8 K
Slow-query-log-file =/usr/local/MySQL/data/slow_query.log // open the slow query in the following three rows. Note that the file permission should be open to mysql users.
Slow_query_log
Long_query_time = 1
Log-error =/usr/local/MySQL/data/error. Log
# Log-queries-not-using-Indexes

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.