Source mode install MySQL 5.6.15

Source: Internet
Author: User
Tags crc32 deprecated

MySQL Master-Slave installation
1 Introduction to the environment

Operating system: Oracle Linux Server Release 6.2
2 Installing the Software
Using the source installation method
1. mysql installation package: mysql-5.6.15.tar.gz
mysql:http://dev.mysql.com/downloads/
2. CMake installation Package
mysql5.5 is compiled by CMake.
wget http://www.cmake.org/files/v2.8/cmake-2.8.4.tar.gz

3  Delete the Oracle Linux-brought MySQL
if the other versions of MySQL are already installed, remove the
3.1  check if MySQL
[[email protected] is installed/]# Rpm-qa | grep-i MySQL
mysql-libs-5.1.52-1.el6_0.1.i686
qt-mysql-4.6.2-20.el6.i686
mysql-server-5.1.52-1.el6_ 0.1.i686
mysql-5.1.52-1.el6_0.1.i686
perl-dbd-mysql-4.013-3.el6.i686

3.2  using Yum to remove MySQL
[[email protected] ~]# yum-y remove  mysql-server-5.1.52-1.el6_0.1.i686
[[email protected] ~]# yum-y Remove mysql-5.1.52-1.el6_0.1.i686
[[email protected] ~]# yum-y Remove mysql-libs-5.1.52-1.el6_0.1.i686
Install MySQL on 4  Primary server 4.1  first install CMake
[[email protected] software]# tar-zxvf cmake-2.8.4.tar.gz
[[email protected] software]# cd cmake-2.8.4
[[email  Protected] cmake-2.8.4]#./configure
[[email protected] cmake-2.8.4]# make
[[email protected] cmake-2.8.4]# make install

4.2  Create a MySQL installation directory and data storage directory
[[email protected] opt]# mkdir/opt/mysql         //installing MySQL
[[email protected] opt]# mkdir/opt/mysql/data    //storing data
4.3  create MySQL user and user group
[[email protected] opt]# groupadd mysql
[[email protected] opt]# Useradd –r–g mysql mysql
gives data directory permissions:
Chown mysql:mysql-r/opt/mysql/data

4.4  compile and install MySQL
?  compilation
[[email protected] software]# tar-zxvf mysql-5.6.15.tar.gz
[[email]  protected] software]# cd mysql-5.6.15
[[email protected] mysql-5.6.15]# cmake-dcmake_install_prefix=/ Opt/mysql \
 -dsysconfdir=/opt/mysql/etc \
 -dmysql_datadir=/opt/mysql/data \
 -DMYSQL_ tcp_port=3306 \
 -dmysql_unix_addr=/tmp/mysqld.sock \
 -dwith_extra_charsets=all \
 - dwith_ssl=bundled \
 -dwith_embedded_server=1 \
 -denabled_local_infile=1 \
 -DWITH_ innobase_storage_engine=1 \
 -ddefault_charset=utf8 \
 -ddefault_collation=utf8_general_ci

parameter description:
 cmake_install_prefix:mysql installation directory
 sysconfdir: Configuration file directory
 mysql_datadir: Database directory
 mysql_tcp_port: Database Port
 mysql_unix_addr: Arrange a directory to put Mysql.sock files, can be set to log storage, data storage directory, such as location
 with_ Extra_charsets: Character
 with_ssl       :the type of SSL
 with_ Embedded_server:whether to build EMBEDDED SERVER (default: OFF)
 enabled_local_infile:whether to enable LOCAL for LOAD Data INFILE (default: OFF)    allow import from local
 with_innobase_storage_engine:  1

See the parameters in detail: http://dev.mysql.com/doc/refman/5.6/en/source-configuration-options.html


If an error occurs, view:
。。。 CMakeError.log, CMakeOutput.log files under/mysql-5.6.15/cmakefiles
Precautions:
When you recompile, you need to clear the old object file and cache information.
# rm-f CMakeCache.txt
? Installation
[[email protected] mysql-5.6.15]# make
[[email protected] mysql-5.6.15]# make install

4.5 Initializing the database
[Email protected] mysql]# Cd/opt/mysql
[Email protected] mysql]# mkdir etc
[Email protected] mysql]# mkdir log
[[email protected] mysql]# chown-r MySQL.
[[email protected] mysql]# chgrp-r MySQL.
[Email protected] mysql]# scripts/mysql_install_db--user=mysql--basedir=/opt/mysql/--datadir=/opt/mysql/data/
Installing MySQL system tables ... 2014-01-23 10:18:50 0 [Warning] TIMESTAMP with implicit the DEFAULT value is deprecated. --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-01-23 10:18:50 20209 [Note] innodb:the InnoDB memory heap is disabled
2014-01-23 10:18:50 20209 [Note] innodb:mutexes and rw_locks use GCC atomic builtins
2014-01-23 10:18:50 20209 [Note] innodb:compressed tables use zlib 1.2.3
2014-01-23 10:18:50 20209 [Note] innodb:using Linux native AIO
2014-01-23 10:18:50 20209 [Note] innodb:not using CPU CRC32 instructions
2014-01-23 10:18:50 20209 [Note] innodb:initializing buffer pool, size = 128.0M
2014-01-23 10:18:50 20209 [Note] innodb:completed initialization of buffer pool
2014-01-23 10:18:50 20209 [Note] innodb:the first specified data file./ibdata1 did not exist:a new database to be creat ed!
2014-01-23 10:18:50 20209 [Note] innodb:setting file./ibdata1 size to MB
2014-01-23 10:18:50 20209 [Note] Innodb:database physically writes the file full:wait ...
2014-01-23 10:18:50 20209 [Note] innodb:setting log file./ib_logfile101 size to + MB
2014-01-23 10:18:53 20209 [Note] innodb:setting log file./ib_logfile1 size to + MB
2014-01-23 10:18:56 20209 [Note] innodb:renaming log file./ib_logfile101 to./ib_logfile0
2014-01-23 10:18:56 20209 [Warning] innodb:new log files created, lsn=45781
2014-01-23 10:18:56 20209 [Note] innodb:doublewrite buffer not found:creating new
2014-01-23 10:18:56 20209 [Note] Innodb:doublewrite buffer created
2014-01-23 10:18:56 20209 [Note] innodb:128 rollback segment (s) is active.
2014-01-23 10:18:56 20209 [Warning] innodb:creating FOREIGN KEY constraint system tables.
2014-01-23 10:18:56 20209 [Note] innodb:foreign key constraint system tables created
2014-01-23 10:18:56 20209 [Note] innodb:creating tablespace and datafile system tables.
2014-01-23 10:18:56 20209 [Note] innodb:tablespace and datafile system tables created.
2014-01-23 10:18:56 20209 [Note] innodb:waiting for purge to start
2014-01-23 10:18:56 20209 [Note] innodb:5.6.15 started; Log sequence number 0
2014-01-23 10:18:58 20209 [Note] Binlog End
2014-01-23 10:18:58 20209 [Note] innodb:fts optimize thread exiting.
2014-01-23 10:18:58 20209 [Note] innodb:starting shutdown ...
2014-01-23 10:18:59 20209 [Note] Innodb:shutdown completed; Log sequence Number 1625977
Ok

Filling Help Tables ... 2014-01-23 10:18:59 0 [Warning] TIMESTAMP with implicit the DEFAULT value is deprecated. --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-01-23 10:19:00 20234 [Note] innodb:the InnoDB memory heap is disabled
2014-01-23 10:19:00 20234 [Note] innodb:mutexes and rw_locks use GCC atomic builtins
2014-01-23 10:19:00 20234 [Note] innodb:compressed tables use zlib 1.2.3
2014-01-23 10:19:00 20234 [Note] innodb:using Linux native AIO
2014-01-23 10:19:00 20234 [Note] innodb:not using CPU CRC32 instructions
2014-01-23 10:19:00 20234 [Note] innodb:initializing buffer pool, size = 128.0M
2014-01-23 10:19:00 20234 [Note] innodb:completed initialization of buffer pool
2014-01-23 10:19:00 20234 [Note] innodb:highest supported file format is Barracuda.
2014-01-23 10:19:00 20234 [Note] innodb:128 rollback segment (s) is active.
2014-01-23 10:19:00 20234 [Note] innodb:waiting for purge to start
2014-01-23 10:19:00 20234 [Note] innodb:5.6.15 started; Log sequence Number 1625977
2014-01-23 10:19:00 20234 [Note] Binlog End
2014-01-23 10:19:00 20234 [Note] innodb:fts optimize thread exiting.
2014-01-23 10:19:00 20234 [Note] innodb:starting shutdown ...
2014-01-23 10:19:01 20234 [Note] Innodb:shutdown completed; Log sequence Number 1625987
Ok

To start mysqld at boot time with to copy
Support-files/mysql.server to the right place for your system

REMEMBER to SET A PASSWORD for the MySQL root USER!
To does so, start the server, then issue the following commands:

/opt/mysql//bin/mysqladmin-u root password ' new-password '
/opt/mysql//bin/mysqladmin-u root-h study1.dlt password ' new-password '

Alternatively you can run:

/opt/mysql//bin/mysql_secure_installation

Which would also give you the option of removing the test
Databases and anonymous user created by default. This is
Strongly recommended for production servers.

See the Manual for more instructions.

You can start the MySQL daemon with:

Cd. ; /opt/mysql//bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

CD mysql-test; Perl mysql-test-run.pl

Problems with the./bin/mysqlbug script!

The latest information about MySQL was available on the Web at

Http://www.mysql.com

Support for MySQL by buying support/licenses at http://shop.mysql.com

new Default Config file was created as/opt/mysql//my.cnf and
would be a used by default if you start it.
You could edit this file to change server settings


[[email protected] mysql]# chown-r root.
[[email protected] mysql]# chown-r mysql data
[[email protected] Mysql]#  bin/mysqld_ Safe--user=mysql &
[3] 20646
[[email protected] mysql]# 140123 10:42:05 mysqld_safe Logging to '/opt/ Mysql/data/study1.dlt.err '.
140123 10:42:05 Mysqld_safe starting mysqld daemon with databases From/opt/mysql/data
4.6  metabase
 & nbsp;   Change Password:
[[email protected] mysql]# bin/mysqladmin-u root password ' mysql '


[email protected] mysql]# CP support-files/mysql.server/etc/init.d/
[email protected] mysql]# CP support-files/my-default.cnf ETC/MY.CNF

Edit Etc/my.cnf,zai [mysqld] Add Lower_case_table_names=1
Setting the Environment:
[Email protected] etc]# cd/etc
[Email protected] etc]# VI profile
Added at the end of the document:
Path=/opt/mysql/bin:/opt/mysql/lib: $PATH
Export PATH

4.7 Manually starting the database
[[Email protected] mysql]# service Mysql.server status
error! MySQL is not running
[[Email protected] mysql]# service Mysql.server start
Starting MySQL ..... success!
[[Email protected] mysql]# service Mysql.server status
success! MySQL Running (31160)
[Email protected] mysql]#
4.8 Setting up auto-start
[Email protected] mysql]# chkconfig--level mysql.server on
[Email protected] mysql]# Chkconfig | grep MySQL
Mysql.server 0:off 1:off 2:on 3:on 4:on 5:on 6:off


Source mode installation mysql 5.6.15

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.