MYSQL-MHA Pre-release environment architecture share (ii) MySQL source installation

Source: Internet
Author: User

To install the MySQL source package:


(1). Install CMake


(mysql5.5 is compiled by CMake later)


Download Unzip cmake-2.8.5.tar.gz


Tar zxf cmake-2.8.12.2.tar.gz-c/usr/local/src


cd/usr/local/src/cmake-2.8.12.2


./configure--prefix=/usr/local/cmake


Make && make install


Export Path=/usr/local/cmake/bin: $PATH



"must depend on package"


CMake make GCC ncurses-devel gcc-c++


(2). Install MySQL


Groupadd MySQL

Useradd-s/sbin/nologin-g MySQL MySQL

Cd/app/mysql_soft


Tar XF mysql-5.6.17.tar.gz

CD mysql-5.6.17


CMake \

-dcmake_install_prefix=/app/mysql \

-dmysql_datadir=/app/mysql/data \

-dmysql_unix_addr=/app/mysql/data/mysql.sock \

-denabled_local_infile=1 \

-dwith_innobase_storage_engine=1 \

-dwith_archive_storage_engine=1 \

-dwith_blackhole_storage_engine=1 \

-dwith_federated_storage_engine=1 \

-dwith_example_storage_engine=1 \

-dwith_partition_storage_engine=1 \

-dwith_myisam_storage_engine=1 \

-dwith_perfschema_storage_engine=1 \

-dmysql_tcp_port=3306 \

-dextra_charsets=all \

-ddefault_charset=utf8 \

-DDEFAULT_COLLATION=UTF8_GENERAL_CI \

-dmysql_user=mysql \

-dwith_debug=0



Make && make install

Chown-r Mysql.mysql/app/mysql

cd/app/mysql/scripts/

./mysql_install_db--user=mysql--basedir=/app/mysql--datadir=/app/mysql/data

Cd..


CD support-files/

CP Mysql.server/etc/rc.d/init.d/mysql

CP MY-DEFAULT.CNF/ETC/MY.CNF

Chkconfig--add MySQL

Chkconfig MySQL on

Service MySQL Start

Ln-s/app/mysql/bin/*/usr/bin/

mysqladmin-u root password ' mysql ' #设置数据库root密码为mysql #






############# #修改配置文件 ##############

Vi/etc/my.cnf


[Mysqld]

Datadir=/app/mysql/data

Socket =/app/mysql/data/mysql.sock

Lower_case_table_names=1

Character-set-server=utf8

Collation-server=utf8_general_ci



[Client]

Default-character-set=utf8




[Mysql.server]

User=mysql

Basedir=/app/mysql

Default-character-set=utf8


[Mysqld_safe]

Err-log=/app/mysql/errlog/mysqld.log







Attention:


If the newspaper:

Mysqladmin:connect to server at ' localhost ' failed

Error: ' Can ' t connect to local MySQL server through socket '/var/lib/mysql/mysql.sock ' (2) '

Check that Mysqld was running and that the socket: '/var/lib/mysql/mysql.sock ' exists!



[Client] Add

Socket =/app/mysql/data/mysql.sock


This article is from "Allen Lee Oracle" blog, please make sure to keep this source http://lipengfei666666.blog.51cto.com/6384154/1613941

MYSQL-MHA Pre-release environment architecture share (ii) MySQL source installation

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.