CentOS6.5 system to build MySQL server

Source: Internet
Author: User

Environment: CentOS 6.5 X86_64-minimal

1 Installing a mysql-compiled package

Yum Remove Mysql-server mysql-y

Yum-y install gcc gcc-c++ ncurses-devel zlib-devel bison cmake openssl-devel perl

2 creating MySQL Users and directories

Useradd MySQL

Mkdir-p/usr/local/mysql

Mkdir-p/db/mysql/data


3 Compiling and installing MySQL

CD ~

Wget-c http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.10.tar.gz

TAR-XZVF mysql-5.6.10.tar.gz

CD mysql-5.6.10

cmake-dcmake_install_prefix=/usr/local/mysql-dmysql_unix_addr=/usr/local/mysql/mysql.sock-ddefault_charset= Utf8-ddefault_collation=utf8_general_ci-dwith_myisam_storage_engine=1-dwith_innobase_storage_engine=1-dwith_ Archive_storage_engine=1-dwith_blackhole_storage_engine=1-dwith_memory_storage_engine=1-dwith_readline=1- denabled_local_infile=1-dmysql_datadir=/db/mysql/data-dmysql_user=mysql-dmysql_tcp_port=3306

Make && make install


4 Configuring MySQL

Modify permissions for the MySQL directory

Chown-r mysql:mysql/usr/local/mysql/

Chown-r mysql:mysql/db/mysql/data/

Initialize MySQL

\cp/usr/local/mysql/support-files/my-default.cnf/etc/my.cnf

Cd/usr/local/mysql

scripts/mysql_install_db--user=mysql--datadir=/db/mysql/data

Adding environment variables

CD ~

echo "Path=/usr/local/mysql/bin:/usr/local/mysql/lib:\ $PATH" >>/etc/profile

echo "Export PATH" >>/etc/profile

Source/etc/profile


Set MySQL boot up

\cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysqld

Chkconfig--add mysqld

Chkconfig mysqld on

Start MySQL

Service mysqld Start

Set MySQL password

mysqladmin-u root password ' 123456 '


Import a developed library file

# ln -sv /usr/local/mysql/include/ /usr/include/mysql #软连接到系统库中 # vim /etc/ld.so.conf.d/mysql.conf #编辑这个文件, 并且添加如下路径 /usr/local/mysql-5 .5.40 /lib # ldconfig #重新加载库文件 # ldconfig -p | grep mysql #让我们来检查下是不是加载好了      libmysqlclient_r.so.16 (libc6,x86-64) =>  /usr/lib64/mysql/libmysqlclient_r .so.16      libmysqlclient.so.18 (libc6,x86-64) =>  /usr/local/mysql-5 .5.40 /lib/libmysqlclient .so.18      libmysqlclient.so.16 (libc6,x86-64) =>  /usr/lib64/mysql/libmysqlclient .so.16      libmysqlclient.so (libc6,x86-64) =>  /usr/local/mysql-5 .5.40 /lib/libmysqlclient .so

CentOS6.5 system to build MySQL server

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.