1. Install the make Compiler (default system)
: Http://www.gnu.org/software/make/
[C-sharp]
View plaincopyprint?
- Tar zxvf make-3.82.tar.gz
- CD make-3.82
- ./Configure
- Make
- Make install
Tar zxvf make-3.82.tar.gz <br/> Cd make-3.82 <br/>./configure <br/> make install
2. Install BISON (it is best to install all the base software before compiling lamp)
: Http://www.gnu.org/software/bison/
[C-sharp]
View plaincopyprint?
- Tar zxvf bison-2.5.tar.gz
- CD bison-2.5
- ./Configure
- Make
- Make install
Tar zxvf bison-2.5.tar.gz <br/> Cd bison-2.5 <br/>./configure <br/> make install
3. Install gcc-C ++
: Http://www.gnu.org/software/gcc/
[C-sharp]
View plaincopyprint?
- Tar zxvf gcc-c00000000-4.4.4.tar.gz
- CD gcc-C ++-4.4.4
- ./Configure
- Make
- Make install
Tar zxvf gcc-c00000000-4.4.tar.gz <br/> Cd gcc-C ++-4.4.4.4 <br/>./configure <br/> make install
4. Install cmake (Please download the latest version for installation)
: Http://www.cmake.org/
[C-sharp]
View plaincopyprint?
- Tar zxvf cmake-2.8.4.tar.gz
- CD cmake-2.8.4
- ./Configure
- Make
- Make install
Tar zxvf cmake-2.8.4.tar.gz <br/> Cd cmake-2.8.4 <br/>./configure <br/> make install
5. Install ncurses
: Http://www.gnu.org/software/ncurses/
[C-sharp]
View plaincopyprint?
- Tar zxvf ncurses-5.8.tar.gz
- CD ncurses-5.8
- ./Configure
- Make
- Make install
Tar zxvf ncurses-5.8.tar.gz <br/> Cd ncurses-5.8 <br/>./configure <br/> make install
Start installing MySQL,: http://dev.mysql.com/
Here I download mysql-5.6.12.tar.gz
Ftp://mirror.switch.ch/mirror/mysql/Downloads/MySQL-5.6/
Preparations
[C-sharp]
View plaincopyprint?
- Groupadd MySQL
- Useradd mysql-G mysql-m-S/sbin/nologin
# Add a user named centos MySQL.-G: Specifies the user group to which the new user belongs)
-M: do not create a root directory
-S: defines the shell it uses./sbin/nologin indicates that the user cannot log on.System.
Groupadd mysql <br/> useradd-r-g MySQL
Decompress and install MySQL
[C-sharp]
View plaincopyprint?
- Tar zxvf mysql-5.6.12.tar.gz
- CD mysql-5.6.12 (below is a line here for your understanding and comments written into line feed comments, in actual compilation please add "\" link before line feed) cmake \
-Dcmake_install_prefix =/usr/local/MySQL \ # installation path
-Dmysql_datadir =/usr/local/MySQL/data \ # data file storage location
-Dsysconfdir =/etc \ # My. CNF path
-Dwith_myisam_storage_engine = 1 \ # support for the myiasm Engine
-Dwith_innobase_storage_engine = 1 \ # InnoDB Engine supported
-Dwith_memory_storage_engine = 1 \ # support for the memory Engine
-Dwith_readline = 1 \ # shortcut key function (I have never used it)
-Dmysql_unix_addr =/tmp/mysqld. Sock \ # connect to the database socket path
-Dmysql_tcp_port = 3306 \ # Port
-Denabled_local_infile = 1 \ # Allow Local Data Import
-Dwith_partition_storage_engine = 1 \ # Database partitions supported for Installation
-Dextra_charsets = all \ # Install all character sets
-Ddefault_charset = utf8 \ # default character
-Ddefault_collation = utf8_general_ci
- Make
- Make install
After completion, continue the following operations
[C-sharp]
View plaincopyprint?
- CD/usr/local/MySQL
- Chown-r MYSQL: mysql. (modify the permission to the root user after the installation is complete)
- Scripts/mysql_install_db -- user = MySQL (perform the following permission modification first)
- Chown-r root: MySQL. (set the permission to the root user and the MySQL group to cancel the read and write permissions of other users. Only the read and write permissions of MySQL "RX" are granted. Other users do not have any permissions)
- Chown-r MYSQL: MySQL. /data (set the database directory to the MySQL user MySQL group, and grant the CHMOD-r ug + rwx read and write execution permission to the database. All other user permissions are deleted and only the MySQL user permission is granted)
CD/usr/local/MySQL <br/> chown-r MySQL. <br/> chgrp-r MySQL. <br/> scripts/mysql_install_db -- user = mysql <br/> chown-r root.
The following command is optional. Copy the MySQL configuration file to/etc.
[C-sharp]
View plaincopyprint?
- CP support-files/my-medium.cnf/etc/My. CNF (the original old version is this operation, 5.6.12 is the following file address)
- CP support-files/my-default.cnf/etc/My. CNF (and to/etc/My. the CNF + x permission deletes write permissions of other users at the same time, and only the root and workgroup RX permissions are granted. All other permissions are deleted even the RX permissions)
CP support-files/my-medium.cnf/etc/My. CNF
# Modify my. CNF Configuration
Vim/etc/My. CNF
# [Mysqld] Add:
Datadir =/data/MySQL
Default-storage-engine = MyISAM
Start MYSQL:
[C-sharp]
View plaincopyprint?
- Bin/mysqld_safe -- user = MySQL &
- # Start MySQL to check whether it is successful
- Netstat-tnl | grep 3306
Bin/mysqld_safe -- user = MySQL & <br/> # Start MySQL and check whether it is successful <br/> netstat-tnl | grep 3306
The above is a method to start MySQL, there is a simple and convenient, as follows:
[C-sharp]
View plaincopyprint?
- # Add the MySQL startup service to the System Service
- CP support-files/MySQL. Server/etc/init. d/MySQL
- # Run the following command to start MYSQL:
- Service MySQL start
- # Stopping the MySQL Service
- Service MySQL stop
- # Restart the MySQL Service
- Service MySQL restart
# Add the MySQL startup service to the System Service <br/> CP support-files/MySQL. server/etc/init. d/MySQL. server <br/> # Run the following command to start mysql <br/> service MySQL. server start <br/> # Stop MySQL service <br/> service MySQL. server stop <br/> # restart MySQL service <br/> service MySQL. server restart
Add the MySQL service to the startup Item to enable the MySQL service to start up.
[C-sharp]
View plaincopyprint?
- Chkconfig -- add MySQL
Change the default root account password. The default password is blank.
Change the password CD to the MySQL directory
CD/usr/local/MySQL
#./Bin/mysqladmin-u Root Password
Press enter to set a new password ..
# Start MySQL
/Usr/local/MySQL/bin/mysqld_safe-defaults-file =/etc/My. CNF &
# Or
/Etc/init. d/MySQL start (Service MySQL start)
# Test whether MySQL is started
#1) check whether a MySQL process exists
PS-Ef | grep MySQL
#2) check whether the port is running
Netstat-tnl | grep 3306
#3) read MySQL version information
Mysqladmin version