1. Install the dependency packages first to avoid problems during the installation process [root@chufeng yusen]# yum -y install wget vim bash-completion [root@chufeng yusen]# yum -y install gcc gcc-c++ cmake ncurses-devel autoconf perl perl-devel 2. Download mysql-5.6.40.tar.gz MySQLxxx download address: https://dev.mysql.com/downloads/mysql/5.6.html#downloads Source package address: https://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.40.tar.gz [root@chufeng yusen]# wget https://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.40.tar.gz [root@chufeng yusen]# ls mysql-5.6.40.tar.gz 3. Create the MySQL installation directory and data storage directory [root@chufeng yusen]# mkdir -p /usr/local/mysql/data 4. Create users and user groups [root@chufeng yusen]# groupadd mysql [root@chufeng yusen]# useradd -r -g mysql mysql 5. Unzip the file to the current folder and install [root@chufeng yusen]# tar -zxvf mysql-5.6.40.tar.gz [root@chufeng yusen]# cd mysql-5.6.40 [root@chufeng mysql-5.6.40]# cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \ -DINSTALL_DATADIR=/usr/local/mysql/data \ -DDEFAULT_CHARSET=utf8 \ -DDEFAULT_COLLATION=utf8_general_ci \ -DEXTRA_CHARSETS=all \ -DENABLED_LOCAL_INFILE=1 [root@chufeng mysql-5.6.40]# make && make install CMAKE parameter description: -DCMAKE_INSTALL_PREFIX=/usr/local/mysql //Default installation directory -DINSTALL_DATADIR=/usr/local/mysql/data //Database storage directory -DDEFAULT_CHARSET=utf8 //Use utf8 characters -DDEFAULT_COLLATION=utf8_general_ci //Check character -DEXTRA_CHARSETS=all //Install all extended character sets -DENABLED_LOCAL_INFILE=1 //Allow data to be imported from local -DMYSQL_USER=mysql -DMYSQL_TCP_PORT=3306 For detailed configuration of CMAKE, please refer to the MySQL official website Note: If the installation fails and you recompile, you need to clear the old object files and cache information. [root@chufeng mysql-5.6.40]# make clean [root@chufeng mysql-5.6.40]# rm -f CMakeCache.txt [root@chufeng mysql-5.6.40]# rm -rf /etc/my.cnf 6. Set directory permissions [root@chufeng yusen]# cd /usr/local/mysql [root@chufeng mysql]# chown -R mysql:mysql . [root@chufeng mysql]# chown -R mysql:mysql data 7. Add the mysql startup service to the system service [root@chufeng yusen]# cd /usr/local/mysql [root@chufeng mysql]# cp support-files/my-default.cnf /etc/my.cnf 8. Create a basic table [root@chufeng yusen]# cd /usr/local/mysql [root@chufeng mysql]# ./scripts/mysql_install_db --user=mysql 9. Configure environment variables (add the following two) [root@chufeng yusen]# vim /etc/profile export MYSQL_HOME="/usr/local/mysql" export PATH="$PATH:$MYSQL_HOME/bin" **#Load environment variables** [root@chufeng yusen]# source /etc/profile 10. Add the mysql startup file to the system startup file [root@chufeng yusen]# cd /usr/local/mysql/ [root@chufeng mysql]# cp support-files/mysql.server /etc/init.d/mysql 11.mysql start, stop and restart commands Start mysql service Restart mysql service Stop mysql service Automatic startup or: Start mysql service Restart mysql service Stop mysql service Add the service to the list of services managed by the boot command Automatic startup 12. Change mysql password [root@chufeng yusen]# mysqladmin -u root password New password: Confirm new password: [root@chufeng yusen]# 13. Connect to MySQL [root@chufeng yusen]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.6.40 Source distribution Copyright (c) 2000, 2016, 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> The mysql-5.6.40 source code installation is now complete. Summarize The above is the CentOs7 64-bit MySQL 5.6.40 source code installation process introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: How to install and configure SSH service in Ubuntu 18.04
>>: Detailed examples of ajax usage in js and jQuery
Table of contents What is a skeleton screen How t...
Table of contents What is virtual dom? Why do we ...
Preface In MySQL, InnoDB belongs to the storage e...
I have also been researching MySQL performance op...
Preface The explain command is the primary way to...
The current requirement is: there is a file uploa...
This article example shares the specific code of ...
In the past few years of my career, I have writte...
1. Installation 1. Download Go to the MySQL offic...
Mac comes with Apache environment Open Terminal a...
The tee command is mainly used to output to stand...
In many cases, you need to process the background...
In Vue, we generally have front-end and back-end ...
【content】: 1. Use background-image gradient style...
The difference between inline elements and block-...