加入收藏 | 设为首页 | 会员中心 | 我要投稿 佛山站长网 (https://www.0757zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 服务器 > 搭建环境 > Linux > 正文

CentOS 6.3下如何源码安装MySQL GA 5.6.10

发布时间:2016-10-08 15:38:01 所属栏目:Linux 来源:网络整理
导读:在编译安装 MySQL 5.6.x 之前,需要最少安装的包有:bison,gcc、gcc-c++、cmake、ncurses-devel, 安装这些依赖包后,把原来解压出来的mysql源码目录删除掉,再重
副标题[/!--empirenews.page--]

在编译安装 MySQL 5.6.x 之前,需要最少安装的包有:bison,gcc、gcc-c++、cmake、ncurses-devel,

安装这些依赖包后,把原来解压出来的mysql源码目录删除掉,再重新解压出来,再去编译.

-- 0

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

-- 1 安装cmake软件包

tar xzvf cmake-2.8.3.tar.gz

./bootstrap

gmake

gmake install

-- 2 create account of mysql

groupadd mysql

useradd -g mysql 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' could 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, should 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...2013-02-08 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).

2013-02-08 04:31:20 63040 [Note] InnoDB: The InnoDB memory heap is disabled

2013-02-08 04:31:20 63040 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins

2013-02-08 04:31:20 63040 [Note] InnoDB: Compressed tables use zlib 1.2.3

2013-02-08 04:31:20 63040 [Note] InnoDB: CPU does not support crc32 instructions

2013-02-08 04:31:20 63040 [Note] InnoDB: Using Linux native AIO

2013-02-08 04:31:20 63040 [Note] InnoDB: Initializing buffer pool, size = 128.0M

2013-02-08 04:31:20 63040 [Note] InnoDB: Completed initialization of buffer pool

2013-02-08 04:31:20 63040 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!

2013-02-08 04:31:20 63040 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB

2013-02-08 04:31:20 63040 [Note] InnoDB: Database physically writes the file full: wait...

2013-02-08 04:31:20 63040 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB

2013-02-08 04:31:20 63040 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB

2013-02-08 04:31:20 63040 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0

2013-02-08 04:31:20 63040 [Warning] InnoDB: New log files created, LSN=45781

2013-02-08 04:31:20 63040 [Note] InnoDB: Doublewrite buffer not found: creating new

2013-02-08 04:31:21 63040 [Note] InnoDB: Doublewrite buffer created

2013-02-08 04:31:21 63040 [Note] InnoDB: 128 rollback segment(s) are active.

2013-02-08 04:31:21 63040 [Warning] InnoDB: Creating foreign key constraint system tables.

2013-02-08 04:31:21 63040 [Note] InnoDB: Foreign key constraint system tables created

2013-02-08 04:31:21 63040 [Note] InnoDB: Creating tablespace and datafile system tables.

2013-02-08 04:31:21 63040 [Note] InnoDB: Tablespace and datafile system tables created.

2013-02-08 04:31:21 63040 [Note] InnoDB: Waiting for purge to start

2013-02-08 04:31:21 63040 [Note] InnoDB: 1.2.10 started; log sequence number 0

2013-02-08 04:31:26 63040 [Note] Binlog end

2013-02-08 04:31:26 63040 [Note] InnoDB: FTS optimize thread exiting.

2013-02-08 04:31:26 63040 [Note] InnoDB: Starting shutdown...

2013-02-08 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).

2013-02-08 04:31:28 63063 [Note] InnoDB: The InnoDB memory heap is disabled

2013-02-08 04:31:28 63063 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins

2013-02-08 04:31:28 63063 [Note] InnoDB: Compressed tables use zlib 1.2.3

2013-02-08 04:31:28 63063 [Note] InnoDB: CPU does not support crc32 instructions

2013-02-08 04:31:28 63063 [Note] InnoDB: Using Linux native AIO

2013-02-08 04:31:28 63063 [Note] InnoDB: Initializing buffer pool, size = 128.0M

2013-02-08 04:31:28 63063 [Note] InnoDB: Completed initialization of buffer pool

2013-02-08 04:31:28 63063 [Note] InnoDB: Highest supported file format is Barracuda.

2013-02-08 04:31:28 63063 [Note] InnoDB: 128 rollback segment(s) are active.

2013-02-08 04:31:28 63063 [Note] InnoDB: Waiting for purge to start

2013-02-08 04:31:28 63063 [Note] InnoDB: 1.2.10 started; log sequence number 1625977

2013-02-08 04:31:28 63063 [Note] Binlog end

2013-02-08 04:31:28 63063 [Note] InnoDB: FTS optimize thread exiting.

2013-02-08 04:31:28 63063 [Note] InnoDB: Starting shutdown...

2013-02-08 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

strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

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 at

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

(编辑:佛山站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

热点阅读