Implement the specific steps of MySQL-8.0 installation through the source code package
This article is mainly about the specific steps of MySQL-8.0 installation through the source package, if you are interested, let's take a look at this article. I believe that after reading the specific steps of MySQL-8.0 installation through the source package, it is of some reference value to everyone.
1) install Mysql database
[root@localhost ~] # rpm-Q mysql mysql-server not installed package mysql not installed package mysql-server [root@localhost ~] # yum-y install ncurses-devel [root@localhost ~] # rpm-Q ncurses-develncurses-devel-5.9-14.20130511.el7_4.x86_64
Install the configuration tool cmake
[root@localhost] # tar xf cmake-3.13.1.tar.gz-C / usr/src/ [root@localhost ~] # cd / usr/src/cmake-3.13.1/ [root@localhost cmake-3.13.1] #. / configure & & gmake & & gmake install
Create a running user
[root@localhost] # useradd-M-s / sbin/nologin mysql
Unpack, configure, compile, install
[root@localhost] # tar xf mysql-8.0.11.tar.gz-C / usr/src/ [root@localhost ~] # cd / usr/src/mysql-8.0.11/ [root@localhost mysql-5.7.24] # cmake-DCMAKE_INSTALL_PREFIX=/usr/local/mysql-DDEFAULT_CHARSET=utf8-DDEFAULT_COLLATION=utf8_general_ci-DWITH_EXTRA_CHARSETS=all-DSYSCONFDIR=/etc & & make & & make install-DCMAKE_INSTALL_PREFIX=/usr/local/mysql / / According to the library program installation directory-DDEFAULT_CHARSET=utf8 / / specify character set encoding-DDEFAULT_COLLATION=utf8_general_ci / / default character set proofreading rules Utf8_general_ci General rules for utf-8 character set-DWITH_EXTRA_CHARSETS=all / / specify additional supported character set encodings-DSYSCONFDIR=/etc / / specify configuration file storage directory
Error handling:
- -CMake Error at cmake/boost.cmake:81 (MESSAGE): You can download it with-DDOWNLOAD_BOOST=1-DWITH_BOOST= This CMake script will look for boost in. If it is not there, it will download and unpack it (in that directory) for you. If you are inside a firewall, you may need to use an http proxy: export http_proxy= http://example.com:80Call Stack (most recent call first): cmake/boost.cmake:238 (COULD_NOT_FIND_BOOST) CMakeLists.txt:507 (INCLUDE)-Configuring incomplete Errors occurred see also "/ usr/src/mysql-5.7.24/CMakeFiles/CMakeOutput.log" .See also "/ usr/src/mysql-5.7.24/CMakeFiles/CMakeError.log".-
The solution is:
1. Create a folder called boost under / usr/local
[root@localhost ~] # mkdir / usr/local/boost
two。 Enter the directory and download boost
[root@localhost ~] # cd / usr/local/boost [root@localhost boost] # wget https://sourceforge.net/projects/boost/files/boost/1.66.0/boost_1_66_0.tar.gz
3. Decompress boost
[root@localhost boost] # tar xf boost_1_66_0.tar.gz
4. Continue cmake and add the red part.
[root@localhost mysql-5.7.24] # cmake-DCMAKE_INSTALL_PREFIX=/usr/local/mysql-DDEFAULT_CHARSET=utf8-DDEFAULT_COLLATION=utf8_general_ci-DWITH_EXTRA_CHARSETS=all-DSYSCONFDIR=/etc-DWITH_BOOST=/usr/local/boost & & make & make install
2) adjustments after installation
Set permissions on the database directory
[root@localhost ~] # cd / usr/local/mysql/ [root@localhost mysql] # chown-R mysql:mysql. /
Create a configuration file (the CentOS7 system supports MariaDB database by default, and the default / etc/my.cnf configuration file is the configuration file of MariaDB)
[root@localhost mysql] # vim / etc/ my.cnf[mysqld] datadir=/usr/local/mysql/datasocket=/tmp/ mysql.sock[mysqld _ safe] log-error=/usr/local/mysql/data/mysql.logpid-file=/usr/local/mysql/data/mysql.pid
3) initialize the database
[root@localhost mysql] #. / bin/mysqld-- user=mysql-- basedir=/usr/local/mysql-- datadir=/usr/local/mysql/data-- initialize2018-12-08T01:51:39.798903Z 1 [Note] A temporary password is generated for root@localhost: dskL0) 8S3FGe--basedir=/usr/local/mysql/ specified installation directory (product directory)-- datadir=/usr/local/mysql/data / / specified data directory-- user=mysql / / specify user identity
4) set environment variables
[root@localhost mysql-5.7.24] # echo "PATH=$PATH:/usr/local/mysql/bin" > / etc/profile [root@localhost mysql-5.7.24] #. / etc/profile = source / etc/profile
5) add system services
Add MySQL to serve the system for management through the systemctl command
[root@localhost mysql-5.7.24] # cp support-files/mysql.server / usr/local/mysql/bin/mysqld.sh [root@localhost mysql-5.7.24] # chmod + x / usr/local/mysql/bin/mysqld.sh [root@localhost ~] # vim / usr/lib/systemd/system/ mysqld.service [Unit] Description=MySQL ServerAfter= network.target [Service] User=mysql # specify the user account that the program is running Group=mysql # specify the group account Type=forkingPIDFile=/usr/ that the program is running Local/mysql/data/localhost.pid # specify the location of the PID file The default is "hostname .pid" ExecStart=/usr/local/mysql/bin/mysqld.sh startExecStop=/usr/local/mysql/bin/mysqld.sh stop [install] WantedBy=mutil-user.target [root@localhost ~] # systemctl start mysqld [root@localhost ~] # systemctl enable mysqldCreated symlink from / etc/systemd/system/mutil-user.target.wants/mysqld.service to / usr/lib/systemd/system/mysqld.service. [root@localhost ~] # systemctl status mysqld ● mysqld.service-MySQL Server Loaded: loaded (/ usr/lib/systemd/system/mysqld.service Enabled; vendor preset: disabled) Active: active (running) since six 2018-12-08 09:54:04 CST; 42s ago Main PID: 2520 (mysqld) CGroup: / system.slice/mysqld.service ├─ 2364 / bin/sh / usr/local/mysql/bin/mysqld_safe-- datadir=/usr/local/mysql/data-- pid... └─ 2520 / usr/local/mysql/bin/mysqld-- basedir=/usr/local/mysql-- datadir=/usr/local/my...12 08 09:53:57 localhost systemd [1]: Starting MySQL Server...12 08 09:54:04 localhost systemd [1]: mysqld.service: Supervising process 2520 which is not...ts.12 08 09:54:04 localhost systemd [1]: Started MySQL Server.12 08 09:54:16 localhost systemd [1]: mysqld.service: Supervising Process 2520 which is not...ts.Hint: Some lines were ellipsized Use-l to show in full. [root@localhost ~] # netstat-lnpt | grep mysqldtcp6 0 0:: 3306: * LISTEN 2520/mysqld
MySQL provides services through the TCP3306 port by default, which can be modified by editing the "port=3306" line in the / etc/my.cnf file.
[root@localhost mysql] # mysqladmin-uroot-p'dskL0) 8S3FGe' password 123456 [root@localhost mysql] # mysql-uroot-p123456mysql: [Warning] Using a password on the command line interface can be insecure.Welcome to the MySQL monitor. Commands end with; or\ g.Your MySQL connection id is 9Server version: 8.0.11 Source distributionCopyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.mysql > exitBye
[root@localhost mysql] #
The above details about the specific steps of MySQL-8.0 installation through the source package, are they helpful to you? If you want to know more about it, you can continue to follow our industry information section.