Install MySQL ga 5.6.10 in centos6.3

Source: Internet
Author: User

[Comment] Before compiling and installing MySQL 5.6.x, the minimum packages required are: Bison, GCC, GCC-C ++, cmake, and ncurses-devel,
After installing these dependency packages, delete the original MySQL source code directory, decompress it again, and then compile.

-- 0
Download mysql-5.6.10.tar.gz in dev.mysql.com

-- 1 install the cmake Software Package
Tar xzvf cmake-2.8.3.tar.gz
./Bootstrap
Gmake
Gmake install

-- 2 create account of MySQL
Groupadd MySQL
Useradd-G MySQL
Autoreconf -- force -- install
Libtoolize -- automake -- force
Automake -- force -- add-Missing

-- 3 complie the sources
Mkdir-P/data/mbdata
Tar xvfz mysql-5.5.20.tar.gz
Yum -- install cmake
Time cmake. -dcmake_install_prefix =/usr/local/mysql56-dmysql_datadir =/data56-dwith_innobase_storage_engine = 1-dmysql_unix_addr =/data56/MySQL. sock-dmysql_user = mysql-ddefault_charset = utf8-ddefault_collation = utf8_general_ci

-- 4 build the DB directy
Time make
Time make install

-- 5 init DB
Ll/usr/local/mysql56/
CD/usr/local/mysql56/
Chown-r MySQL.
Chgrp-r MySQL.
CP support-files/my-default.cnf/etc/my56.cnf
Scripts/mysql_install_db -- user = MySQL -- basedir =/usr/local/mysql56 -- datadir =/data56 -- defaults-file =/etc/my56.cnf

[Root @ MySQL mysql56] # scripts/mysql_install_db -- user = MySQL -- basedir =/usr/local/mysql56 -- datadir =/data56 -- defaults-file =/etc/my56.cnf
Warning: the host 'mysql. YEST. Nos 'cocould not be looked up with/usr/local/mysql56/bin/resolveip.
This probably means that your libc libraries are not 100% compatible
With this binary MySQL version. The MySQL daemon, mysqld, shocould work
Normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
When specifying MySQL privileges!

Installing MySQL system tables... 04:31:20 0 [Warning] timestamp with implicit default value is deprecated. Please use -- explicit_defaults_for_timestamp server option (see documentation for more details ).
04:31:20 63040 [note] InnoDB: the InnoDB memory heap is disabled
04:31:20 63040 [note] InnoDB: mutexes and rw_locks use GCC atomic builtins
04:31:20 63040 [note] InnoDB: Compressed tables use zlib 1.2.3
04:31:20 63040 [note] InnoDB: CPU does not support CRC32 instructions
04:31:20 63040 [note] InnoDB: Using Linux native AIO
04:31:20 63040 [note] InnoDB: initializing buffer pool, size = 128.0 m
04:31:20 63040 [note] InnoDB: Completed initialization of Buffer Pool
04:31:20 63040 [note] InnoDB: The first specified data file./ibdata1 did not exist: a new database to be created!
04:31:20 63040 [note] InnoDB: setting file./ibdata1 size to 12 Mb
04:31:20 63040 [note] InnoDB: Database physically writes the file full: Wait...
04:31:20 63040 [note] InnoDB: Setting log file./ib_logfile101 size to 48 MB
04:31:20 63040 [note] InnoDB: Setting log file./ib_logfile1 size to 48 MB
04:31:20 63040 [note] InnoDB: Renaming log file./ib_logfile101 to./ib_logfile0
04:31:20 63040 [Warning] InnoDB: New log files created, LSN = 45781
04:31:20 63040 [note] InnoDB: doublewrite buffer not found: creating new
04:31:21 63040 [note] InnoDB: doublewrite buffer created
04:31:21 63040 [note] InnoDB: 128 rollback segment (s) are active.
04:31:21 63040 [Warning] InnoDB: creating foreign key constraint system tables.
04:31:21 63040 [note] InnoDB: foreign key constraint system tables created
04:31:21 63040 [note] InnoDB: Creating tablespace and datafile system tables.
04:31:21 63040 [note] InnoDB: tablespace and datafile system tables created.
04:31:21 63040 [note] InnoDB: Waiting for purge to start
04:31:21 63040 [note] InnoDB: 1.2.10 started; log sequence number 0
04:31:26 63040 [note] BINLOG end
04:31:26 63040 [note] InnoDB: FTS optimize thread exiting.
04:31:26 63040 [note] InnoDB: Starting shutdown...
04:31:28 63040 [note] InnoDB: shutdown completed; log sequence number 1625977
OK

Filling help tables... 2013-02-08 04:31:28 0 [Warning] timestamp with implicit default value is deprecated. Please use -- explicit_defaults_for_timestamp server option (see documentation for more details ).
04:31:28 63063 [note] InnoDB: the InnoDB memory heap is disabled
04:31:28 63063 [note] InnoDB: mutexes and rw_locks use GCC atomic builtins
04:31:28 63063 [note] InnoDB: Compressed tables use zlib 1.2.3
04:31:28 63063 [note] InnoDB: CPU does not support CRC32 instructions
04:31:28 63063 [note] InnoDB: Using Linux native AIO
04:31:28 63063 [note] InnoDB: initializing buffer pool, size = 128.0 m
04:31:28 63063 [note] InnoDB: Completed initialization of Buffer Pool
04:31:28 63063 [note] InnoDB: highest supported file format is barracuda.
04:31:28 63063 [note] InnoDB: 128 rollback segment (s) are active.
04:31:28 63063 [note] InnoDB: Waiting for purge to start
04:31:28 63063 [note] InnoDB: 1.2.10 started; log sequence number 1625977
04:31:28 63063 [note] BINLOG end
04:31:28 63063 [note] InnoDB: FTS optimize thread exiting.
04:31:28 63063 [note] InnoDB: Starting shutdown...
04:31:30 63063 [note] InnoDB: shutdown completed; log sequence number 1625987
OK

To start mysqld at boot time you have to copy
Support-files/MySQL. Server to the right place for your system

Please remember to set a password for the MySQL Root User!
To do so, start the server, then issue the following commands:

/Usr/local/mysql56/bin/mysqladmin-u Root Password 'new-password'
/Usr/local/mysql56/bin/mysqladmin-u root-H mysql. YEST. Nos password 'new-password'

Alternatively you can run:

/Usr/local/mysql56/bin/mysql_secure_installation

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

See the manual for more instructions.

You can start the MySQL daemon:

CD.;/usr/local/mysql56/bin/mysqld_safe &

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

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

Please report any problems with the./bin/mysqlbug script!

The latest information about MySQL is available on the Web

Http://www.mysql.com

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

New default config file was created as/usr/local/mysql56/My. CNF and
Will be used by default by the server when you start it.
You may edit this file to change server settings

-- 6 copy start command

CP support-files/MySQL. Server/etc/init. d/mysqld56
Chmod 700/etc/init. d/mysqld56
Echo "Export Path = $ path:/usr/local/mysql56/bin">/etc/profile
Source/etc/profile

 

 

-- 7 add command to system parameter
CD/data/mbdata
Chkconfig -- add mysqld56

-- 8 start service
Service mysqld56 start

-============================================== ======================================
[PS] semi-synchronous Replication
-- ===================================================== ======================================
MySQL AB replication principle:
The master server (master server) records all operations involving database updates to the binary log,
Then the slave server (slave server) will connect to the master server through the io_thread thread, such as, and then the master server will respond to the slave server through io_thread, and then start to transmit binary logs. After the server receives the corresponding log records, it will execute the changes recorded in the logs through the SQL _thread thread.

Implementation level: Row level, statement level, and mixed level
Replication latency: asynchronous replication (MySQL AB replication is a natural attribute), real-time replication (MySQL + drbd), and semi-synchronous replication (> = Version 5.5, not complete yet)

1. Install the semi-synchronous Replication Module

Master> install plugin rpl_semi_sync_master soname 'semisync _ Master. so'; the parameter rpl_semi_sync_master_enabled = 1 takes effect. If you do not comment out the parameter during installation, the error unknown variable 'rpl _ semi_sync_master_enabled = 1' is returned.

Slave1> install plugin rpl_semi_sync_slave soname 'semisync _ slave. so ';

2. Activate semi-synchronous Replication
Master> set global rpl_semi_sync_master_enabled = on;

Slave> set global rpl_semi_sync_slave_enabled = on;
Slave> stop slave io_thread;
Slave> Start slave io_thread;

Master> show status like 'rpl _ semi_sync_master_status ';
+ ---------- + --- +
| Variable_name | value |
+ ---------- + --- +
| Rpl_semi_sync_master_status | on |
+ ---------- + --- +

Master> show status like 'rpl _ semi_sync_master_clients ';
+ ---------- + --- +
| Variable_name | value |
+ ---------- + --- +
| Rpl_semi_sync_master_clients | 1 | <--- indicates that a slave server uses the semi-synchronous mode.
+ ------------------------------ + ------- +

3. confirm that the semi-Sync Mode is in use.
Master> insert into user values (8, 'moto ');
Master> show status like 'rpl _ semi_sync_master_yes_tx ';
+ ---------- + --- +
| Variable_name | value |
+ ---------- + --- +
| Rpl_semi_sync_master_yes_tx | 1 | <-value indicates how many transactions are confirmed by the slave server.
+ ---------- + --- +

Verification:
Shut down the network of the master node and submit the updated data. The system will wait for 10 seconds to return the data. Because the master server is waiting for confirmation from the slave server and will return the result after 10 seconds of timeout, the master server will return to the asynchronous mode.

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.