mysql5.6 Centos6.6 installation

1. Check the firewall is turned off
Service iptables Status
Service iptables STOP
chkconfig iptables OFF

2. SELINUX
vim /etc/selinux/config
SELINUX=disabled

SELinux (Security-Enhanced Linux) is a United States National Security Agency (NSA) to implement mandatory access control, Linux is the history of the most prominent new security subsystem. NSA is the development of an access control system with the help of the Linux community, within the limits of this access control system, the process can access only those in his task by the required documents. SELinux installed by default on Fedora and Red Hat Enterprise Linux, you can also get other distributions as easy to install package.

3. Configure yum source


4.
groupadd mysql
useradd -d /home/mysql -g mysql -m mysql

5.
su - mysql
vi .bash_profile
PATH=$PATH:$HOME/bin:/u01/my3306/bin

6.
mkdir -p /u01/my3306/data
mkdir -p /u01/my3306/log/iblog
mkdir -p /u01/my3306/log/binlog
mkdir -p /u01/my3306/log/run
mkdir -p /u01/my3306/tmp
mkdir -p /u01/my3306/run

chown -R mysql:mysql /u01/my3306
chmod -R 755 /u01/my3306

7.
yum install -y cmake gcc gcc-c++ ncurses-devel bison zlib libxml
yum install -y openssl-devel

8.预编译
cmake \
-DCMAKE_INSTALL_PREFIX=/u01/my3306 \
-DINSTALL_DATADIR=/u01/my3306/data \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DEXTRA_CHARSETS=all \
-DWITH_SSL=yes \
-DWITH_EMBEDDED_SERVER=1 \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DMYSQL_UNIX_ADDR=/u01/my3306/run/mysql.sock \
-DMYSQL_TCP_PORT=3306 \
-DENABLED_LOCAL_INFILE=1 \
-DSYSCONFDIR=/etc \
-DWITH_READLINE=on

9.
Configuring incomplete, errors occurred!
删除txt
find / -name CMakeCache.txt
rm -f /root/mysql/mysql-5.6.12/CMakeCache.txt

10.
make
make install

11.
my.cnf upload this file
cd / u01 / my3306

12.
chown -R mysql:mysql /u01/my3306/

13. Database Initialization
SU - MySQL
CD / u01 / my3306
based information database initialization parameter file my.cnf executed
must be performed in this path
./scripts/mysql_install_db --defaults-file = / u01 / my3306 / my.cnf --datadir = / u01 / my3306 / data --user = mysql

./scripts/mysql_install_db --defaults-file=/u01/my3307/my.cnf --datadir=/u01/my3307/data --basedir=/u01/my3306 --user=mysql

14.启动mysql
cd /u01/my3306/bin
./mysqld_safe --defaults-file=/u01/my3306/my.cnf --user=mysql &

15. The connection to the database
mysql -h127.0.0.1 -uroot

mysql -h127.0.0.1 -uroot -P3306

Uppercase P port
lowercase p password

 

Guess you like

Origin www.cnblogs.com/dbalightyear/p/11237103.html