Red Hat5下源码安装mysql5.6过程记录

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Red Hat5下源码安装mysql5.6过程记录相关的知识,希望对你有一定的参考价值。

 

1.安装cmake包

[[email protected] soft]# tar -xzf cmake-3.0.0.tar.Z 
[[email protected] soft]# cd cmake-3.0.0
[[email protected] cmake-3.0.0]# ./configure   #对包进行初始化配置
......
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Looking for wsyncup in /usr/lib/libcurses.so
-- Looking for wsyncup in /usr/lib/libcurses.so - found
-- Looking for cbreak in /usr/lib/libncurses.so
-- Looking for cbreak in /usr/lib/libncurses.so - found
-- Looking for elf.h
-- Looking for elf.h - found
-- Looking for a Fortran compiler
-- Looking for a Fortran compiler - /usr/bin/f95
-- Performing Test run_pic_test
-- Performing Test run_pic_test - Success
-- Configuring done
-- Generating done
-- Build files have been written to: /root/soft/cmake-3.0.0
---------------------------------------------
CMake has bootstrapped.  Now run gmake.
[[email protected] cmake-3.0.0]# gmake   #配置完成后进行编译
......

[ 99%] Building CXX object Tests/CMakeLib/CMakeFiles/runcompilecommands.dir/run_compile_commands.cxx.o
Linking CXX executable runcompilecommands
[ 99%] Built target runcompilecommands
Scanning dependencies of target foo
[ 99%] Building CXX object Tests/FindPackageModeMakefileTest/CMakeFiles/foo.dir/foo.cpp.o
Linking CXX static library libfoo.a
[ 99%] Built target foo
Scanning dependencies of target memcheck_fail
[ 99%] Building CXX object Tests/CTestTestMemcheck/CMakeFiles/memcheck_fail.dir/ret1.cxx.o
Linking CXX executable memcheck_fail
[ 99%] Built target memcheck_fail
Scanning dependencies of target pseudo_BC
[ 99%] Building CXX object Tests/CTestTestMemcheck/CMakeFiles/pseudo_BC.dir/ret0.cxx.o
Linking CXX executable BC
[ 99%] Built target pseudo_BC
Scanning dependencies of target pseudo_purify
[ 99%] Building CXX object Tests/CTestTestMemcheck/CMakeFiles/pseudo_purify.dir/ret0.cxx.o
Linking CXX executable purify
[ 99%] Built target pseudo_purify
Scanning dependencies of target pseudo_valgrind
[100%] Building CXX object Tests/CTestTestMemcheck/CMakeFiles/pseudo_valgrind.dir/ret0.cxx.o
Linking CXX executable valgrind
[100%] Built target pseudo_valgrind
Scanning dependencies of target pseudonl_BC
[100%] Building C object Tests/CTestTestMemcheck/NoLogDummyChecker/CMakeFiles/pseudonl_BC.dir/ret0.c.o
Linking C executable BC
[100%] Built target pseudonl_BC
Scanning dependencies of target pseudonl_purify
[100%] Building C object Tests/CTestTestMemcheck/NoLogDummyChecker/CMakeFiles/pseudonl_purify.dir/ret0.c.o
Linking C executable purify
[100%] Built target pseudonl_purify
Scanning dependencies of target pseudonl_valgrind
[100%] Building C object Tests/CTestTestMemcheck/NoLogDummyChecker/CMakeFiles/pseudonl_valgrind.dir/ret0.c.o
Linking C executable valgrind
[100%] Built target pseudonl_valgrind
[[email protected] cmake-3.0.0]# make install  #编译完成后进行安装
......
-- Installing: /usr/local/share/cmake-3.0/Templates/CPack.GenericLicense.txt
-- Installing: /usr/local/share/cmake-3.0/Templates/DLLHeader.dsptemplate
-- Installing: /usr/local/share/cmake-3.0/Templates/EXEWinHeader.dsptemplate
-- Installing: /usr/local/share/cmake-3.0/Templates/CPack.GenericWelcome.txt
-- Installing: /usr/local/share/cmake-3.0/Templates/CTestScript.cmake.in
-- Installing: /usr/local/share/cmake-3.0/Templates/TestDriver.cxx.in
-- Installing: /usr/local/share/cmake-3.0/Templates/CMakeVSMacros1.vsmacros
-- Installing: /usr/local/share/cmake-3.0/Templates/CMakeVSMacros2.vsmacros
-- Installing: /usr/local/share/cmake-3.0/Templates/EXEFooter.dsptemplate
-- Installing: /usr/local/share/cmake-3.0/Templates/cygwin-package.sh.in
-- Installing: /usr/local/share/cmake-3.0/Templates/CPackConfig.cmake.in
-- Installing: /usr/local/share/cmake-3.0/Templates/staticLibFooter.dsptemplate
-- Installing: /usr/local/share/cmake-3.0/Templates/CMakeVisualStudio6Configurations.cmake
-- Installing: /usr/local/share/cmake-3.0/Templates/CPack.GenericDescription.txt
-- Installing: /usr/local/share/cmake-3.0/Templates/EXEHeader.dsptemplate
-- Installing: /usr/local/share/cmake-3.0/Templates/staticLibHeader.dsptemplate
-- Installing: /usr/local/doc/cmake-3.0/cmsys/Copyright.txt
-- Installing: /usr/local/doc/cmake-3.0/cmzlib/Copyright.txt
-- Installing: /usr/local/doc/cmake-3.0/cmcurl/COPYING
-- Installing: /usr/local/doc/cmake-3.0/cmcompress/Copyright.txt
-- Installing: /usr/local/doc/cmake-3.0/cmlibarchive/COPYING
-- Installing: /usr/local/doc/cmake-3.0/cmexpat/COPYING
-- Installing: /usr/local/bin/ccmake
-- Installing: /usr/local/bin/cmake
-- Installing: /usr/local/bin/ctest
-- Installing: /usr/local/bin/cpack
-- Installing: /usr/local/share/cmake-3.0/include/cmCPluginAPI.h
-- Installing: /usr/local/share/cmake-3.0/editors/vim/cmake-help.vim
-- Installing: /usr/local/share/cmake-3.0/editors/vim/cmake-indent.vim
-- Installing: /usr/local/share/cmake-3.0/editors/vim/cmake-syntax.vim
-- Installing: /usr/local/share/cmake-3.0/editors/emacs/cmake-mode.el
-- Installing: /usr/local/share/aclocal/cmake.m4
-- Installing: /usr/local/share/cmake-3.0/completions/cmake
-- Installing: /usr/local/share/cmake-3.0/completions/cpack
-- Installing: /usr/local/share/cmake-3.0/completions/ctest

 

2.创建mysql用户信息

[[email protected] ~]# useradd -M -u 49 -s /sbin/nologin mysql
[[email protected] ~]# mkdir -p /var/mysql/data
[[email protected] ~]# mkdir -p /var/mysql/log
[[email protected] ~]# chown -R mysql.mysql /var/mysql
[[email protected] ~]# ll /var/mysql
total 8
drwxr-xr-x 2 mysql mysql 4096 Feb  1 12:44 data
drwxr-xr-x 2 mysql mysql 4096 Feb  1 12:44 log

 

3.编译安装mysql

[[email protected] local]# mkdir mysql
[[email protected] local]# cd mysql/
[[email protected] mysql]# pwd
/usr/local/mysql
[[email protected] data]# mkdir /var/lib/mysql
[[email protected] data]# cd /var/lib/mysql/
[[email protected] mysql]# pwd
/var/lib/mysql
[[email protected] mysql]# cd /root/mysql-5.6.19
[[email protected] mysql-5.6.19]# cmake -DCMAKE_BUILD_TYPE:STRING=Release > -DMYSQL_USER=mysql > -DCMAKE_INSTALL_PREFIX=/usr/local/mysql > -DMYSQL_DATADIR=/var/mysql/data > -DSYSCONFDIR=/etc > -DWITH_MYISAM_STORAGE_ENGINE=1 > -DWITH_INNOBASE_STORAGE_ENGINE=1 > -DWITH_MEMORY_STORAGE_ENGINE=1 > -DWITH_ARCHIVE_STORAGE_ENGINE=1 > -DWITH_BLACKHOLE_STORAGE_ENGINE=1 > -DWITHOUT_FEDERATED_STORAGE_ENGINE=1 > -DWITH_READLINE=1 > -DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock > -DMYSQL_TCP_PORT=3306 > -DENABLED_LOCAL_INFILE=1 > -DEXTRA_CHARSETS=all > -DDEFAULT_CHARSET=utf8 > -DWITH_SSL=yes  > -DDEFAULT_COLLATION=utf8_general_ci
......

 

[[email protected] cmake-3.0.0]# make
.......
[ 99%] Generating mysqlserver_depends.c
Scanning dependencies of target mysqlserver
[ 99%] Building C object libmysqld/CMakeFiles/mysqlserver.dir/mysqlserver_depends.c.o
Linking C static library libmysqld.a
/usr/bin/ar: creating /root/mysql-5.6.19/libmysqld//libmysqld.a
[ 99%] Built target mysqlserver
Scanning dependencies of target mysql_client_test_embedded
[ 99%] Building C object libmysqld/examples/CMakeFiles/mysql_client_test_embedded.dir/__/__/tests/mysql_client_test.c.o
Linking CXX executable mysql_client_test_embedded
[ 99%] Built target mysql_client_test_embedded
Scanning dependencies of target mysql_embedded
[ 99%] Building CXX object libmysqld/examples/CMakeFiles/mysql_embedded.dir/__/__/client/completion_hash.cc.o
[ 99%] Building CXX object libmysqld/examples/CMakeFiles/mysql_embedded.dir/__/__/client/mysql.cc.o
/root/mysql-5.6.19/client/mysql.cc:1555: warning: dereferencing type-punned pointer will break strict-aliasing rules
/root/mysql-5.6.19/client/mysql.cc:1555: warning: dereferencing type-punned pointer will break strict-aliasing rules
[100%] Building CXX object libmysqld/examples/CMakeFiles/mysql_embedded.dir/__/__/client/readline.cc.o
Linking CXX executable mysql_embedded
[100%] Built target mysql_embedded
Scanning dependencies of target mysqltest_embedded
[100%] Building CXX object libmysqld/examples/CMakeFiles/mysqltest_embedded.dir/__/__/client/mysqltest.cc.o
/root/mysql-5.6.19/client/mysqltest.cc: In function 鈥榗har* re_eprint(int)鈥?
/root/mysql-5.6.19/client/mysqltest.cc:8236: warning: unused variable 鈥榣en鈥?
                                                                                Linking CXX executable mysqltest_embedded
[100%] Built target mysqltest_embedded
Scanning dependencies of target my_safe_process
[100%] Building CXX object mysql-test/lib/My/SafeProcess/CMakeFiles/my_safe_process.dir/safe_process.cc.o
Linking CXX executable my_safe_process
[100%] Built target my_safe_process

编译的可能会报错,要注意内存的大小,去掉-DWITHOUT_PARTITION_STORAGE_ENGINE=1参数
-DWITHOUT_PARTITION_STORAGE_ENGINE=1参数在本次make的时候大约80%的时候会报错

注意:如果重新编译或者编译出错了,需要清除旧的对象文件和缓存信息。

# make clean

# rm -f CMakeCache.txt

# rm -rf /etc/my.cnf

然后再:make , make install即可。

 

[[email protected] cmake-3.0.0]# make install
......
-- Installing: /usr/local/mysql/man/man1/myisam_ftdump.1
-- Installing: /usr/local/mysql/man/man1/mysql_install_db.1
-- Installing: /usr/local/mysql/man/man1/mysql_config.1
-- Installing: /usr/local/mysql/man/man1/mysql_tzinfo_to_sql.1
-- Installing: /usr/local/mysql/man/man1/mysqlbug.1
-- Installing: /usr/local/mysql/man/man1/mysql_upgrade.1
-- Installing: /usr/local/mysql/man/man1/mysqlshow.1
-- Installing: /usr/local/mysql/man/man1/myisamchk.1
-- Installing: /usr/local/mysql/man/man1/mysql_find_rows.1
-- Installing: /usr/local/mysql/man/man1/mysqlcheck.1
-- Installing: /usr/local/mysql/man/man1/mysqlimport.1
-- Installing: /usr/local/mysql/man/man1/innochecksum.1
-- Installing: /usr/local/mysql/man/man1/mysqld_safe.1
-- Installing: /usr/local/mysql/man/man1/msql2mysql.1
-- Installing: /usr/local/mysql/man/man1/mysql_client_test.1
-- Installing: /usr/local/mysql/man/man1/mysql_plugin.1
-- Installing: /usr/local/mysql/man/man1/mysql_client_test_embedded.1
-- Installing: /usr/local/mysql/man/man1/mysql_secure_installation.1
-- Installing: /usr/local/mysql/man/man1/mysql.server.1
-- Installing: /usr/local/mysql/man/man1/mysql_fix_extensions.1
-- Installing: /usr/local/mysql/man/man1/resolve_stack_dump.1
-- Installing: /usr/local/mysql/man/man1/mysql-stress-test.pl.1
-- Installing: /usr/local/mysql/man/man1/mysql.1
-- Installing: /usr/local/mysql/man/man1/mysqladmin.1
-- Installing: /usr/local/mysql/man/man1/mysql-test-run.pl.1
-- Installing: /usr/local/mysql/man/man1/mysql_convert_table_format.1
-- Installing: /usr/local/mysql/man/man1/my_print_defaults.1
-- Installing: /usr/local/mysql/man/man1/mysqldump.1
-- Installing: /usr/local/mysql/man/man1/mysql_setpermission.1
-- Installing: /usr/local/mysql/man/man1/mysqlhotcopy.1
-- Installing: /usr/local/mysql/man/man1/perror.1
-- Installing: /usr/local/mysql/man/man8/mysqld.8
[[email protected] mysql]# ll /usr/local/mysql/
total 160
drwxr-xr-x  2 root root  4096 Feb  1 15:43 bin
-rw-r--r--  1 root root 17987 May  6  2014 COPYING
drwxr-xr-x  3 root root  4096 Feb  1 15:42 data
drwxr-xr-x  2 root root  4096 Feb  1 15:42 docs
drwxr-xr-x  3 root root  4096 Feb  1 15:42 include
-rw-r--r--  1 root root 89163 May  6  2014 INSTALL-BINARY
drwxr-xr-x  3 root root  4096 Feb  1 15:42 lib
drwxr-xr-x  4 root root  4096 Feb  1 15:43 man
drwxr-xr-x 10 root root  4096 Feb  1 15:43 mysql-test
-rw-r--r--  1 root root  2496 May  6  2014 README
drwxr-xr-x  2 root root  4096 Feb  1 15:43 scripts
drwxr-xr-x 28 root root  4096 Feb  1 15:43 share
drwxr-xr-x  4 root root  4096 Feb  1 15:43 sql-bench
drwxr-xr-x  2 root root  4096 Feb  1 15:43 support-files

 

4.修改配置

[[email protected] mysql-5.6.19]# cp support-files/my-default.cnf /etc/my.cnf
[[email protected] mysql-5.6.19]# vi /etc/my.cnf 

# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. Its a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.

[mysqld]

# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M

# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin

# These are commonly set, remove the # and set as required.
# basedir = .....
# datadir = .....
# port = .....
# server_id = .....
# socket = .....

# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
datadir =/var/mysql/data
skip-name-resolve
lower_case_table_names = 1
character-set-server = utf8
query_cache_limit = 10M
max_heap_table_size = 64M
max_connections = 2000
log-error=/var/mysql/log/mysql_error.log
pid-file =/var/mysql/log/mysql.pid
general_log = 1
log_output= TABLE
log-bin =/var/mysql/log/mysql_bin
slow_query_log = ON
slow_query_log_file=/var/mysql/log/mysql_slow.log
long_query_time = 2
explicit_defaults_for_timestamp=true
"/etc/my.cnf" 46L, 1531C written
[[email protected] mysql-5.6.19]# 

 

4.初始化数据库

[[email protected] mysql-5.6.19]# /usr/local/mysql/scripts/mysql_install_db > --user=mysql > --datadir=/var/mysql/data > --basedir=/usr/local/mysql > --log-output=file
Installing MySQL system tables...[[email protected] mysql-5.6.19]# 

 

系统只提示Installing MySQL system tables...就结束了,感觉不正常,查看系统日志:

[[email protected] log]# tail -f mysql_error.log

2016-02-01 16:39:16 14116 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2016-02-01 16:39:16 14116 [Note] InnoDB: The InnoDB memory heap is disabled
2016-02-01 16:39:16 14116 [Note] InnoDB: Mutexes and rw_locks use InnoDBs own implementation
2016-02-01 16:39:16 14116 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-02-01 16:39:16 14116 [Note] InnoDB: Using Linux native AIO
2016-02-01 16:39:16 14116 [Note] InnoDB: Not using CPU crc32 instructions
2016-02-01 16:39:16 14116 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-02-01 16:39:16 14116 [Note] InnoDB: Completed initialization of buffer pool
2016-02-01 16:39:16 14116 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2016-02-01 16:39:16 14116 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2016-02-01 16:39:16 14116 [Note] InnoDB: Database physically writes the file full: wait...    --此处发现空间已满
2016-02-01 16:39:16 b7f2b6d0 InnoDB: Error: Write to file ./ibdata1 failed at offset 0.
InnoDB: 1048576 bytes should have been written, only -1 were written.
InnoDB: Operating system error number 28.
InnoDB: Check that your OS and file system support files of this size.
InnoDB: Check also that the disk is not full or a disk quota exceeded.
InnoDB: Error number 28 means No space left on device.
InnoDB: Some operating system error numbers are described at
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/operating-system-error-codes.html
2016-02-01 16:39:16 14116 [ERROR] InnoDB: Error in creating ./ibdata1: probably out of disk space
2016-02-01 16:39:16 14116 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
2016-02-01 16:39:16 14116 [ERROR] Plugin InnoDB init function returned error.
2016-02-01 16:39:16 14116 [ERROR] Plugin InnoDB registration as a STORAGE ENGINE failed.
2016-02-01 16:39:16 14116 [ERROR] /usr/loc

 

[[email protected] ~]$ df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda1             36554508  35078436         0 100% /
tmpfs                  1037712         0   1037712   0% /dev/shm

 

发现磁盘空间不足,增加磁盘后将mysql的数据及日志文件挂载到新磁盘,以下为挂载过程(虚拟机):

[[email protected] ~]# cd /var/mysql/
[[email protected] mysql]# ls
data  log
[[email protected] mysql]# ll 
total 8
drwxr-xr-x 4 mysql mysql 4096 Feb  1 16:39 data
drwxr-xr-x 2 mysql mysql 4096 Feb  1 16:39 log
[[email protected] mysql]# ll -d /var/mysql
drwxr-xr-x 4 mysql mysql 4096 Feb  1 12:44 /var/mysql
[[email protected] mysql]# rm -rf *
[[email protected] mysql]# vi /etc/fstab 

LABEL=/                 /                       ext3    defaults        1 1
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
LABEL=SWAP-sda2         swap                    swap    defaults        0 0
/dev/sdb1              /var/mysql               ext3    defaults        0 0
~                                                                                                                                                                                                                                                                                                                                            
"/etc/fstab" 7L, 532C written
[[email protected] mysql]# mount -a
[[email protected] mysql]# df -m
Filesystem           1M-blocks      Used Available Use% Mounted on
/dev/sda1                35698     34257         0 100% /
tmpfs                     1014         0      1014   0% /dev/shm
/dev/sdb1                10077       151      9414   2% /var/mysql
[[email protected] mysql]# mkdir data
[[email protected] mysql]# mkdir log
[[email protected] mysql]# ll
total 8
drwxr-xr-x 2 root root 4096 Feb  2 08:36 data
drwxr-xr-x 2 root root 4096 Feb  2 08:36 log
[[email protected] mysql]# chown mysql.mysql *
[[email protected] mysql]# ll
total 8
drwxr-xr-x 2 mysql mysql 4096 Feb  2 08:38 data
drwxr-xr-x 2 mysql mysql 4096 Feb  2 08:37 log
[[email protected] mysql]# 

 

然后再清理下/dev/sda1下不用文件,清理下oracle下的归档文件及日志文件:

[[email protected] archivelog_dest]$ df -m
Filesystem           1M-blocks      Used Available Use% Mounted on
/dev/sda1                35698     17766     16091  53% /
tmpfs                     1014         0      1014   0% /dev/shm
/dev/sdb1                10077       151      9414   2% /var/mysql

 

重新执行mysql_install_db脚本:

[[email protected] mysql-5.6.19]# /usr/local/mysql/scripts/mysql_install_db > --user=mysql > --datadir=/var/mysql/data > --basedir=/usr/local/mysql > --log-output=file
Installing MySQL system tables...OK

Filling help tables...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/mysql/bin/mysqladmin -u root password new-password
  /usr/local/mysql/bin/mysqladmin -u root -h edu password new-password

Alternatively you can run:

  /usr/local/mysql/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/mysql/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 at http://bugs.mysql.com/

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

WARNING: Found existing config file /usr/local/mysql/my.cnf on the system.
Because this file might be in use, it was not replaced,
but was used in bootstrap (unless you used --defaults-file)
and when you later start the server.
The new default config file was created as /usr/local/mysql/my-new.cnf,
please compare it with your file and take the changes you need.

WARNING: Default config file /etc/my.cnf exists on the system
This file will be read by default by the MySQL server
If you do not want to use this, either remove it, or use the
--defaults-file argument to mysqld_safe when starting the server

 

5.启动mysql数据库

[[email protected] mysql-5.6.19]# ln -s /usr/local/mysql/bin/* /usr/local/bin/
[[email protected] mysql-5.6.19]# ln -s /usr/local/mysql/lib/* /usr/lib/
[[email protected] mysql-5.6.19]# ln -s /usr/local/mysql/include/* /usr/include/
[[email protected] mysql-5.6.19]# ldconfig
[[email protected] mysql-5.6.19]# cp /root/mysql-5.6.19/support-files/mysql.server /etc/init.d/mysqld
[[email protected] mysql-5.6.19]# chmod 755 /etc/init.d/mysqld 
[[email protected] mysql-5.6.19]# /etc/init.d/mysqld status
MySQL is not running                                       [FAILED]
[[email protected] ~]# /etc/init.d/mysqld start
Starting MySQL....The server quit without updating PID file[FAILED]ysql/log/mysql.pid).

发现启动失败,查看错误日志:

[[email protected] log]# tail -f mysql_error.log
2016-02-02 09:21:00 5875 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2016-02-02 09:21:00 5875 [Note] InnoDB: The InnoDB memory heap is disabled
2016-02-02 09:21:00 5875 [Note] InnoDB: Mutexes and rw_locks use InnoDBs own implementation
2016-02-02 09:21:00 5875 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-02-02 09:21:00 5875 [Note] InnoDB: Using Linux native AIO
2016-02-02 09:21:00 5875 [Note] InnoDB: Not using CPU crc32 instructions
2016-02-02 09:21:00 5875 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-02-02 09:21:00 5875 [Note] InnoDB: Completed initialization of buffer pool
2016-02-02 09:21:00 5875 [Note] InnoDB: Highest supported file format is Barracuda.
2016-02-02 09:21:00 5875 [Note] InnoDB: 128 rollback segment(s) are active.
2016-02-02 09:21:00 5875 [Note] InnoDB: Waiting for purge to start
2016-02-02 09:21:00 5875 [Note] InnoDB: 5.6.19 started; log sequence number 1626037
2016-02-02 09:21:00 5875 [Note] Server hostname (bind-address): *; port: 3306
2016-02-02 09:21:00 5875 [Note] IPv6 is available.
2016-02-02 09:21:00 5875 [Note]   - :: resolves to ::;
2016-02-02 09:21:00 5875 [Note] Server socket created on IP: 以上是关于Red Hat5下源码安装mysql5.6过程记录的主要内容,如果未能解决你的问题,请参考以下文章

mysql5.6.12 源码安装记录

下载mysql5.6源码在linux下安装

Ubuntu15.04下源码安装MySQL5.6.26数据库

Linux下源码安装mysql5.6

CentOs下MySQL5.6.32源码安装

CentOS6.5源码安装MySQL5.6.35