MySQL-5.6.36 compiled installation tutorial, writeup!

First, MySQL is a relational database, what is the relational relational database, we also talked about the advantages and disadvantages, in a blog: https://blog.51cto.com/14573101/2447264


Now let's talk about, MySQL installation, which has several:
1.RPM | yum install fast speed, easy to install, can not be customized
2. Binary: no need to install, extract that is used, can not be customized
3. Compile Installation: Slow can be customized
prior to 5.5: ./configure make make install
after 5.5: CMake gmake
4. compile and then an RPM, library production yum, yum then install
simple and fast, can be customized, slightly more complex, long production time


Here we choose 3. Compile install, ready to install the first package, here we are using MySQL5.6.36
click on the official download mysql-5.6.36.tar.gz
Baidu cloud disk to download the official website MySQL5.6.36: extraction code: r46x
1 installation and dependencies CMake:
yum install -y ncurses-devel libaio-devel cmake
2. Create mysql user
useradd -s /sbin/nologin -M mysql
to check the user: id mysql
3. Place the downloaded installation package uploaded to the system software storage directory
4. decompressed
tar xf mysql-5.6.36
5. after entering extract the directory
cd mysql-5.6.36
6. start the installation;

cmake . -DCMAKE_INSTALL_PREFIX=/application/mysql-5.6.36 \
-DMYSQL_DATADIR=/application/mysql-5.6.36/data \
-DMYSQL_UNIX_ADDR=/application/mysql-5.6.36/tmp/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_EXTRA_CHARSETS=all \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \
-DWITH_ZLIB=bundled \
-DWITH_SSL=bundled \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_EMBEDDED_SERVER=1 \
-DENABLE_DOWNLOADS=1 \
-DWITH_DEBUG=0
make && make install

These are our own metadata definitions, can be common
so far compiled start optimizing the configuration
7. soft connection to make mysql directory (the role of making soft connections: easy to upgrade, optimization commands, etc.)
ln -s /application/mysql-5.6.36/ /application/mysql
8. copy of the configuration file

\cp support-files/my*.cnf /etc/my.cnf

9. initialize the database
/application/mysql/scripts/mysql_install_db --basedir=/application/mysql/ --datadir=/application/mysql/data --user=mysql
10. Create tmp directory (as above, we define the sock file here)
mkdir -p /application/mysql/tmp
11. mysql folder to set permissions to prevent insufficient privileges and other issues
chown -R mysql.mysql /application/mysql/
12. Set the startup script
\cp -a support-files/mysql.server /etc/init.d/mysqld
13. mysql can start up!
/etc/init.d/mysqld start
checking whether the start

netstat -lntup|grep 3306
ps -ef|grep mysql
lsof -i:3306

14. The configuration environment variable

echo 'PATH=/application/mysql/bin/:$PATH' >>/etc/profile
tail -1 /etc/profile
source /etc/profile
在命令行输入mysql即可进入,默认空密码
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.6.36 Source distribution

Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 

note! Less every step, especially download dependence and initialize the database, if there is an error log can be viewed or re-perform troubleshooting steps!
For questions, please leave a message to contact bloggers hope this article will help you move towards the pinnacle of life, marry white Formica!
Congratulations, configure MySQL!

Guess you like

Origin blog.51cto.com/14573101/2447395