First, pre-installation preparation
1. Install the Make compiler
Make Compiler: http://www.gnu.org/software/make/
(The system comes with the default) to see if your system installs a software, if it is already, it will not be installed, but it may be uninstalled before.
If you have previously used RPM-IVH make, use
# Rpm-qa | grep make must be able to find it.
If you are using
Make && make install installed. Then it's better to go straight to the execution.
# Find/-name matlab
If loaded, it will tell you which directory the execution program was released to.
++++++++++++++++++++++++++++++++++++++++++
# RPM-QA is to see if the software is installed, # grep and # Find is the view file location
++++++++++++++++++++++++++++++++++++++++++
# tar ZXVF make-3.82.tar.gz
# CD make-3.82
#./configure
# make
# make Install
2. Installing Bison
Bison: http://www.gnu.org/software/bison/
# tar ZXVF bison-2.5.tar.gz
# CD bison-2.5
#./configure
# make
# make Install
3. Installing gcc-c++
gcc-c++: http://www.gnu.org/software/gcc/
# tar ZXVF gcc-c++-4.4.4.tar.gz
# CD gcc-c++-4.4.4
#./configure
# make
# make Install
4. Installing CMake
CMake: http://www.cmake.org/
# tar ZXVF cmake-2.8.4.tar.gz
# CD cmake-2.8.4
#./configure
# make
# make Install
5. Installing ncurses
ncurses: http://www.gnu.org/software/ncurses/
# tar ZXVF ncurses-5.8.tar.gz
# CD ncurses-5.8
#./configure
# make
# make Install
Second, the MySQL installation process
1. Basic Installation and Configuration
MySQL5.6: http://dev.mysql.com/
Here i download the mysql-5.6.12.tar.gz here
ftp://mirror.switch.ch/mirror/mysql/Downloads/MySQL-5.6/
Preparatory work
# Groupadd MySQL
# useradd Mysql-g mysql-m-s/sbin/nologin
#增加一个名为 the MySQL user.
-G: Specifies the user group (group) to which the new user belongs
-M: Do not establish root directory
-S: Defines the shell,/sbin/nologin that it uses to represent users who cannot log on to the system.
Unzip and install MySQL
# tar ZXVF mysql-5.6.12.tar.gz
# CD mysql-5.6.12
# CMake./
# make
# make Install
# Cd/usr/local/mysql
# Chown-r Mysql:mysql. (#这里最后是有个. Please note that in order to complete the security installation, modify the permissions to the root user)
# scripts/mysql_install_db--user=mysql (do this first and then modify the following permissions)
# Chown-r Root:mysql. (Set the permissions to the root user, set to the MySQL group, cancel the read and write execution rights of other users, leave only the MySQL "Rx" read Execute permission, no other users have any permissions)
# Chown-r Mysql:mysql./data (Database storage directory set to MySQL user MySQL group)
# Chmod-r ug+rwx. (Grant read and write execution permissions, all other user rights are removed only to MySQL user rights)
The following command copies the MySQL configuration file to/etc
# CP SUPPORT-FILES/MY-DEFAULT.CNF/ETC/MY.CNF
(versions prior to 5.6 use the following command)
# CP SUPPORT-FILES/MY-MEDIUM.CNF/ETC/MY.CNF (prior to 5.6 is this operation, the reader can also enter the Support-files folder at this time, see the real name of the configuration file, that exists, copy that. )
Modifying the MY.CNF configuration
# VI/ETC/MY.CNF
#[mysqld] Add below:
User=mysql
Datadir=/data/mysql
Default-storage-engine=myisam
#chmod-R 755/usr/local/mysql/data
Use the command "Ps-ef|grep mysqld" to see if there is a mysqld process, kill with "kill-9 process number" and then restart mysqld!
#关闭seLinux Open/etc/selinux/config, change selinux=enforcing to Selinux=disable
2. Start and test MySQL
start MySQL
# Bin/mysqld_safe--user=mysql & or go directly under the Bin folder
# CD Bin
#./mysqld \ This shows that Mysqld_safe or mysqld can be started.
Start MySQL to see if it's successful
# ps–ef|grep MySQL
650) this.width=650; "Name=" image_operate_29041378125270236 "src=" http://s8.sinaimg.cn/mw690/ 6d39ac7egx6clek1fjp47&690 "width=" 637 "height=" 155 "alt=" Linux under source installation mysql <wbr>5.6 "title=" Linux under the source installation MySQL <wbr>5.6 "style=" margin:0px;padding:0px;border:0px;list-style:none;width:561px;height:135px; "/>
# Netstat-tnl|grep 3306
650) this.width=650; "Name=" image_operate_99131378124942136 "src=" http://s12.sinaimg.cn/mw690/ 6d39ac7egx6cleolg9z3b&690 "width=" 644 "height=" "alt=" Linux under the source installation MySQL <wbr>5.6 "title=" Linux under the source installation MySQL <wbr>5.6 "style=" margin:0px;padding:0px;border:0px;list-style:none;width:564px;height:49px; "/>
The above is a way to start MySQL, there is a simple convenience, as follows:
To add the MySQL startup service to the system service
# CP Support-files/mysql.server/etc/init.d/mysql
You can now start MySQL using the following command
# service MySQL Start
Stop MySQL Service
# service MySQL Stop
Restart MySQL Service
# service MySQL Restart
650) this.width=650; "Name=" image_operate_13951378125268946 "src=" http://s7.sinaimg.cn/mw690/ 6d39ac7egx6cletjrfs36&690 "width=" 542 "height=" "alt=" Linux under the source installation MySQL <wbr>5.6 "title=" Linux under the source installation of MySQL <wbr>5.6 "style=" margin:0px;padding:0px;border:0px;list-style:none;width:509px;height:91px; "/>
3. Password modification:
# chkconfig--add MySQL
Modify the default root account password, the default password is empty
Change Password CD switch to the directory where MySQL resides
# Cd/usr/local/mysql
#./bin/mysqladmin-u Root Password
Enter to set a new password in the following prompt:
650) this.width=650; "Name=" image_operate_66451378125266709 "src=" http://s12.sinaimg.cn/mw690/ 6d39ac7egx6clf4yf2z6b&690 "width=" 456 "height=" 108 "alt=" Linux under source installation mysql <wbr>5.6 "title=" Linux under the source installation MySQL <wbr>5.6 "style=" margin:0px;padding:0px;border:0px;list-style:none;width:458px;height:112px; "/>
At last
# service MySQL restart; (Restart MySQL server)
# cd/usr/local/mysql/bin/(into the bin under MySQL basedir)
#./mysql-u root-p (Open client)
# use MySQL
The above is the whole process, so perfect!
This article is from "peter-unscrupulousness Youth" blog, please be sure to keep this source http://petervip.blog.51cto.com/3790959/1679259
Linux source installation MySQL 5.6 (classic)