third, compile and installmysql-5.5.33
1, preparing the file system for data storage:
Create a new logical volume ( process See link ) and mount it to the/mydata/data directory as a storage directory for MySQL data.
http://858004880.blog.51cto.com/7265424/1759317
2, the new user runs the process in a secure manner:
1. Delete the system's original MySQL user home directory [[EMAIL PROTECTED] ~]# USERDEL -R MYSQL2. Create a MySQL system user group [[email Protected] ~]# groupadd -r mysql3. Add the MySQL user to the MySQL group and indicate the path [[email protected] ~]# useradd -g mysql -r -s/sbin/nologin -M -d /mydata/data mysqluseradd[options] login -g GID: Indicates the basic group that the user belongs to, can be a group name, or gid; -d/PATH/TO/HOME_DIR: ; the home directory with the specified path -s SHELL: indicates the user's default SHELL program, The available lists are in the/etc/shells file; -r: Create a System user -M: do not automatically create a user's home directory [[Email protected] ~]# cat /etc/passwdmysql:x:498:499::/mydata/data:/sbin/nologin4. Modifying the data file belongs to the main:[[email protected] ~]# chown -r mysql:mysql/mydata/data/[[email protected] ~]# ll /mydata/total 4drwxr-xr-x3 mysql mysql 4096 apr 1 16:21 data
3, download and install
3.1 Installing the required GCC gcc-c++ ncurses-devel perl libraries:
[Email protected] tools]# yum-y install gcc gcc-c++ ncurses-devel perl
3.2 Installing CMRK
[[email protected] tools]# wget https://cmake.org/files/v3.5/cmake-3.5.0.tar.gz[[email protected] tools]# tar XF Cmake-3.5.0.tar.gz[[email protected] tools]# CD Cmake-3.5.0[[email protected] cmake-3.5.0]#./bootstrap[[email protected]]# Make&&make Install
3.3 Downloads Mysql5.6.29
Http://dev.mysql.com/downloads/mysql/5.6.html
650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M02/7E/ED/wKiom1cM757DduqeAAVkTJwbR3o992.jpg "style=" float: none; "title=" 1.jpg "alt=" Wkiom1cm757dduqeaavktjwbr3o992.jpg "/>
650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M01/7E/ED/wKiom1cM76HAwms-AALb3C6HNMo739.jpg "style=" float: none; "title=" 2.jpg "alt=" Wkiom1cm76hawms-aalb3c6hnmo739.jpg "/>
3.4 Download Unzip:
[Email protected] tools]# wget http://cdn.mysql.com//downloads/mysql-5.5/mysql-5.5.48.tar.gz[[email protected]]# Tar XF mysql-5.5.48.tar.gz.1
4. Compile and install:
[Email protected] tool]# cdmysql-5.5.48 [email protected]]# cmake-dcmake_install_prefix=/usr/local/mysql-dmysql_ Datadir=/mydata/data-dsysconfdir=/etc-dwith_myisam_storage_engine=1-dwith_innobase_storage_engine=1-dwith_ memory_storage_engine=1-dwith_readline=1-dmysql_unix_addr=/usr/local/mysql/mysql.sock-dmysql_tcp_port=3306- Denabled_local_infile=1-dwith_partition_storage_engine=1-dextra_charsets=all-ddefault_charset=utf8-ddefault_ collation=utf8_general_ci# make && make install
5. Modify MySQL directory Owners and Groups
[Email protected] mysql-5.5.48]# cd/usr/local/mysql/[[email protected]]# chown-r mysql:mysql.
6. Initialize MySQL database
# Scripts/mysql_install_db--basedir=/usr/local/mysql--datadir=/mydata/data--user=mysq
7. Provide the main configuration file my.cnf for MySQL:
[email protected] mysql]# CP support-files/my-large.cnf/etc/my.cnf
# and modify the value of thread_concurrency in this file to multiply your number of CPUs by 2, for example, use the following line:
Thread_concurrency = 2
# also add the following line to specify where the MySQL data file will be stored:
DataDir =/mydata/data
[[email protected] mysql]# vim/etc/my.cnf [mysqld]# Try number of CPU ' s*2 forthread_concurrencythread_concurrency = 2data DIR =/mydata/data# The following two lines of code must be added: innodb_file_per_table = 1skip_name_resolve = 1
8 , provide SYSV service script for MySQL:
[Email protected] mysql]# cpsupport-files/mysql.server/etc/rc.d/init.d/mysqld[[email protected]]# chmod +x/etc/rc.d /init.d/mysqld
9. Add to the list of services:
[Email protected] mysql]# chkconfig--add mysqld[[email protected]]# chkconfig mysqld on
You can then start the service test using.
in order to use the MySQL installation to conform to the system usage specification and export its development components to the system, the following steps are required:
10, output the MySQL man manual to the man command to find the path:
to editthe/etc/man.config, add the following line:
Manpath/usr/local/mysql/man
[[email protected] mysql]# vim /etc/man.config # /var/cache/man/.../[locale/]catx/page.x.# the keyword fhswill cause this behaviour (AND OVERRIDES FSSTND) .# explicitly givencatdirs override.## Fsstndfhs## this file is alsoread by man in order to find how to call nroff, less, etc.,# and to determinethe correspondence between extensions and decompressors.## manbin /usr/local/bin/man## Every automaticallygenerated manpath includes these fields#manpath /usr/manmanpath / usr/share/manmanpath /usr/local/manmanpath /usr/local/share/manmanpath /usr/x11r6/manmanpath/ Usr/local/mysql/man
11, output MySQL header file to the System header file path/usr/include:
This can be achieved by simply creating a link:
# Ln-sv/usr/local/mysql/include/usr/include/mysql
12. Output MySQL library file to the system library to find the path:
# echo '/usr/local/mysql/lib ' >/etc/ld.so.conf.d/mysql.conf
The system is then re-loaded into the system library:
# Ldconfig
13, modify the PATH environment variable, so that the system can directly use MySQL related commands.
Edit/etc/profile, add at the end:
[Email protected] mysql]# Vim/etc/profilepath=/usr/local/mysql/bin:/usr/local/mysql/lib: $PATHexportPATH
Save to exit, and then execute:
[Email protected] mysql]# Source/etc/profile
environment variable added successfully
14. Enter the MySQL command:
[Email protected] mysql]# mysqlwelcome to the MySQL monitor. Commands End With; or \g.your MySQL connection ID is 2Server version:5.5.48-log Source distribution Copyright (c), Oracle and/or Itsaffiliates. All rights reserved. Oracle is a registered trademark of oraclecorporation and/or itsaffiliates. Other names trademarks of Theirrespectiveowners. Type ' help ', ' or ' \h ' for help. Type ' \c ' to clearthe the current input statement. Mysql>
Description MySQL Installation successful!
15. Modify the password of the MySQL user root
The default is a blank password login:
# mysql-u Root–p
Set the root password:mysql> set PASSWORD = PASSWORD (' 123456 ');
Change the password to test123:mysql> SET PASSWORD for ' root ' @ ' localhost ' = PASSWORD (' test123 '); Query OK, 0 rows Affected (0.00 sec) mysql> SET PASSWORD for ' root ' @ ' 127.0.0.1 ' = PASSWORD (' test123 '); Query OK, 0 rows Affected (0.00 sec) mysql> FLUSH privileges; Queryok, 0 rows Affected (0.00 sec)
View Users:
Mysql> select distinct concat (' User: ', user, ' ' @ ', host, '; ') as query from mysql.user;+---------------------------------+| query |+---------------------------------+| user: ' phpmyadmin ' @ ' 127.0.0.1 '; | | User: ' root ' @ ' 127.0.0.1 '; | | User: ' root ' @ ':: 1 '; | | User: ' @ ' localhost '; | | User: ' phpmyadmin ' @ ' localhost '; | | User: ' root ' @ ' localhost '; | | User: ' @ ' web.example.com '; | | User: ' root ' @ ' web.example.com '; |+---------------------------------+8 rows in set (0.04 sec) mysql>
MySQL installation is complete!
Next: Four, compile and install php-5.5.34
This article is from the "Flood City time and Space" blog, please be sure to keep this source http://858004880.blog.51cto.com/7265424/1763177
Third, compile and install mysql-5.5.33