Referring to the online information, I used cmake to install MySQL5.7.18 on the CentOS6.8 server. I encountered various problems during the installation process. Most of the problems can be solved on the Internet. For the problems that could not be solved, I uninstalled and uninstalled them again, and finally the installation was successful. I sorted out the installation process and archived it for future use. Install MySQL related dependencies: yum -y install gcc gcc-c++ gcc-g77 make cmake bison ncurses-devel autoconf automake zlib* fiex* libxml* libmcrypt* libtool-ltdl-devel* libaio libaio-devel bzr libtool ncurses5-devel imake libxml2-devel expat-devel Install boost_1_59_0 (must be this version): 1. Get the source code: If you download it to the /usr/local/src directory, enter the directory cd /usr/local/src and get the source code package Copy the code as follows: wget https://sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz/download 2. Decompression: tar -xzvf boost_1_59_0.tar.gz 3. Enter the boost directory: cd boost_1_59_0 4. Configure: ./bootstrap.sh 5. Compile: ./b2 6. Installation: ./b2 install After the compilation and installation is complete, the boost header files will be copied to the /usr/local/include/ directory, and the library files will be in /usr/local/lib/. Install cmake (latest version): 1. Get the source code: Still download it to the /usr/local/src directory, cd /usr/local/src, get the software package wget https://cmake.org/files/v3.8/cmake-3.8.0.tar.gz 2. Decompression: tar -xzvf cmake-3.8.0.tar.gz 3. Enter the cmake directory: cd cmake-3.8.0 4. ./bootstrap 5. gmake 6. gmake install Install mysql5.7.18: 1. Add mysql user and group: /usr/sbin/groupadd mysql /usr/sbin/useradd -g mysql mysql 2. Create MySQL installation directory and data directory mkdir /usr/local/mysql mkdir /usr/local/mysql/data 3. Modify the mysql directory owner chown -R mysql:mysql /usr/local/mysql 4. Get the MySQL source package: still in the /usr/local/src directory wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.18.tar.gz 5. Decompression: tar -xzvf mysql-5.7.18.tar.gz 6. Enter the mysql directory: cd mysql-5.7.18 7. Cmake compilation configuration: cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \ -DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock \ -DMYSQL_DATADIR=/usr/local/mysql/mydata \ -DSYSCONFDIR=/etc \ -DEXTRA_CHARSETS=all \ -DDEFAULT_CHARSET=utf8 \ -DDEFAULT_COLLATION=utf8_general_ci \ -DWITH_MYISAM_STORAGE_ENGINE=1 \ -DWITH_INNOBASE_STORAGE_ENGINE=1 \ -DWITH_MEMORY_STORAGE_ENGINE=1 \ -DWITH_READLINE=1 \ -DMYSQL_TCP_PORT=3306 \ -DENABLED_LOCAL_INFILE=1 \ -DWITH_PARTITION_STORAGE_ENGINE=1 \ -DWITH_SSL=yes \ -DWITH_BOOST=/usr/local/src/boost_1_59_0 \ -DMYSQL_USER=mysql 8. Compile and install: make && make install 9. Go to the bin directory of MySQL installation and initialize the database cd /usr/local/mysql/bin ./mysqld --initialize --user=mysql --datadir=/usr/local/mysql/data/ --basedir=/usr/local/mysql --socket=/usr/local/mysql/mysql.sock After running, the last sentence [note] generates a mysql default password, copy it to a place and save it. 10. Add MySQL service, copy MySQL configuration file and return to MySQL installation directory cd .. 11. The information on the Internet shows that there is a my.cnf file to be edited, but I did not find the my.cnf file after installation. I checked the information and it said that if there is no such configuration, the system default configuration will be run, so the configuration of my.cnf is omitted here. 12. Start MySQL service mysql start 13. Set the system to start automatically chkconfig mysql on 14. Log in to MySQL Go to the bin directory of the MySQL installation directory and type cd bin ./mysql -uroot -p Enter password: //Enter the default password saved previously 15. Change the root password SET PASSWORD = PASSWORD('mysql123'); 16. Refresh MySQL system permission related tables flush privileges; 17. Exit mysql: quit; At this point, the compilation and installation is complete. The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
>>: Analysis and practice of React server-side rendering principle
Step 1: View the current kernel rew $ uname -a Li...
Preface Sass is an extension of the CSS3 language...
1 Introduction After "Maven deploys Springbo...
Are you still using rem flexible layout? Does it ...
<br />Related articles: Web skills: Multiple...
1 Introduction Good coding habits are qualities t...
Using Nginx's proxy_cache to build a cache se...
This question originated from a message on Nugget...
Effect display The built-in boot interface is too...
The webpage displays 403 Forbidden Nginx (yum ins...
Table of contents 1.kvm deployment 1.1 kvm instal...
This article introduces Nginx from compilation an...
By default, Flash will always be displayed at the ...
WeChat applet trajectory playback mainly uses pol...
Automated project deployment is more commonly use...