1. SOURCE Package Download
Source package is usually also used tar.gz compression, the name contains only version information, the size of the RPM package, the binary package is much smaller, the extracted files contain install-source files, from the MySQL official website (http://www.mysql.com/ downloads/) downloads, such as: mysql-5.5.17.tar.gz
2. CMake
Before installing the MySQL instance with the source package, let's introduce the CMake compiler tool. Before MySQL 5.5, the Configure tool was used to execute the source code compiled, to MySQL 5.5, to CMake to compile. This is a more advanced compiler configuration tool than make, can be based on different platforms, different compilers to produce the corresponding makefile or vcproj project, so you need to first download CMake tools and installation from the official website (http://www.cmake.org).
Installing the GCC package before installing CMake
RPM-IVH kernel-headers-2.6.18-308.el5.x86_64.rpm
RPM-IVH glibc-headers-2.5-81.x86_64.rpm
RPM-IVH glibc-devel-2.5-81.x86_64.rpm
RPM-IVH gcc-4.1.2-52.el5.x86_64.rpm
RPM-IVH libstdc++-devel-4.1.2-52.el5.x86_64.rpm
RPM-IVH gcc-c++-4.1.2-52.el5.x86_64.rpm
Installing CMake
/mysql/cmake-2.8.3
./configure
Gmake && make Install
3. Install MySQL 5.5.17
1. Create a MySQL system group and users
Groupadd MySQL
Useradd–g MySQL MySQL
2. Set user operating system resource limits
Vi/etc/security/limits.conf
MySQL Soft nproc 2047
MySQL Hard Nproc 16384
MySQL Soft nofile 1024
MySQL Hard nofile 65536
Package Required for installation
# RPM-IVH ncurses-devel-5.5-24.20060715.x86_64.rpm
# RPM-IVH bison-2.3-2.1.x86_64.rpm
3. Install MySQL Server
#mkdir/opt/mysql
#chown-R Mysql:mysql/opt/mysql
#gunzip mysql-5.5.17.tar.gz
#tar XVF Mysql-5.5.17.tar
#cd mysql-5.5.17
# cmake-dcmake_install_prefix=/opt/mysql \
>-dmysql_user=mysql \
>-dmysql_tcp_port=3306 \
>-dmysql_datadir=/opt/mysql/data \
>-dwith_myisam_storage_engine=1 \
>-dwith_innobase_storage_engine=1 \
>-dwith_archive_storage_engine=1 \
>-dwith_memory_storage_engine=1 \
>-dwith_blackhole_storage_engine=1 \
>-dwith_partition_storage_engine=1 \
>-denabled_local_infile=1 \
>-dwith_readline=1 \
>-dwith_ssl=yes \
>-ddefault_charset=utf8 \
>-ddefault_collation=utf8_general_ci \
>-dextra_charsets=all
#make
#make Install
Initialize DB
# sh scripts/mysql_install_db--user=mysql--basedir=/opt/mysql--datadir=/opt/mysql/data
Installing MySQL system tables ...
Ok
Filling Help Tables ...
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 mysql 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; /opt/mysql/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
Cd/opt/mysql/mysql-test; Perl mysql-test-run.pl
Problems with The/opt/mysql/scripts/mysqlbug script!
4. Start MySQL Sever
Configuring service Services
# Cp/opt/mysql/files/mysql.server/etc/init.d/mysql--Configure Basedir, DataDir
Configure MySQL parameter file my.cnf
#vi/etc/my.cnf
[Client]
#password = Your_password
Port = 3306
Socket =/opt/mysql/data/mysql.sock
[Mysqld]
Port = 3306
Server-id = 24
DataDir =/opt/mysql/data
Socket =/opt/mysql/data/mysql.sock
Pid-file =/opt/mysql/data/mysql.pid
Character-set-server = UTF8
Default_storage_engine = InnoDB
Log-bin =/opt/mysql/data/mysql-bin
Binlog_format = row
Sync-binlog = 1
Slow-query-log = On
Slow-query-log-file =/opt/mysql/data/mysql-slow.log
Log_error =/opt/mysql/data/mysql.err
max_connections = 2000
Back_log = 50
Skip-external-locking
Skip-name-resolve
Key_buffer_size = 256M
Max_allowed_packet = 1M
Table_open_cache = 2000
Sort_buffer_size = 1M
Read_buffer_size = 1M
Read_rnd_buffer_size = 4M
Myisam_sort_buffer_size = 64M
Thread_cache_size = 8
Query_cache_size = 16M
Thread_concurrency = 8
Innodb_data_home_dir =/opt/mysql/data
Innodb_data_file_path = Ibdata1:10m:autoextend
Innodb_log_group_home_dir =/opt/mysql/data
Innodb_buffer_pool_size = 256M
Innodb_additional_mem_pool_size = 20M
Innodb_log_file_size = 64M
Innodb_log_buffer_size = 8M
Innodb_flush_log_at_trx_commit = 1
Innodb_lock_wait_timeout = 50
[Mysqldump]
Quick
Max_allowed_packet = 16M
[MySQL]
No-auto-rehash
#safe-updates
[Myisamchk]
Key_buffer_size = 128M
Sort_buffer_size = 128M
Read_buffer = 2M
Write_buffer = 2M
[Mysqlhotcopy]
Interactive-timeout
"/ETC/MY.CNF" [New] 62L, 1531C written
[Email protected] support-files]# MORE/ETC/MY.CNF
[Client]
#password = Your_password
Port = 3306
Socket =/opt/data/mysql.sock
[Mysqld]
Port = 3306
Server-id = 24
DataDir =/opt/mysql/data
Socket =/opt/mysql/data/mysql.sock
Pid-file =/opt/mysql/data/mysql.pid
Character-set-server = UTF8
Default_storage_engine = InnoDB
Log-bin =/opt/mysql/data/mysql-bin
Binlog_format = row
Sync-binlog = 1
Slow-query-log = On
Slow-query-log-file =/opt/mysql/data/mysql-slow.log
Log_error =/opt/mysql/data/mysql.err
max_connections = 2000
Back_log = 50
Skip-external-locking
Skip-name-resolve
Key_buffer_size = 256M
Max_allowed_packet = 1M
Table_open_cache = 2000
Sort_buffer_size = 1M
Read_buffer_size = 1M
Read_rnd_buffer_size = 4M
Myisam_sort_buffer_size = 64M
Thread_cache_size = 8
Query_cache_size = 16M
Thread_concurrency = 8
Innodb_data_home_dir =/opt/mysql/data
Innodb_data_file_path = Ibdata1:10m:autoextend
Innodb_log_group_home_dir =/opt/mysql/data
Innodb_buffer_pool_size = 256M
Innodb_additional_mem_pool_size = 20M
Innodb_log_file_size = 64M
Innodb_log_buffer_size = 8M
Innodb_flush_log_at_trx_commit = 1
Innodb_lock_wait_timeout = 50
[Mysqldump]
Quick
Max_allowed_packet = 16M
[MySQL]
No-auto-rehash
#safe-updates
[Myisamchk]
Key_buffer_size = 128M
Sort_buffer_size = 128M
Read_buffer = 2M
Write_buffer = 2M
[Mysqlhotcopy]
Interactive-timeout
# service MySQL Start
Starting MySQL .... [OK]
mysql5.5.17 Source Installation