Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Detailed steps of installing MySQL5.7.28 source code under CentOS7.4

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

The following is about the detailed steps of installing MySQL5.7.28 source code under CentOS7.4. The secret of the text lies in being close to the topic. So, no gossip, let's read the following directly, I believe you will benefit from reading the detailed steps of how to install MySQL5.7.28 source code under CentOS7.4.

The specific installation steps are as follows:

(1) Uninstall mariadb first, otherwise it will conflict with the libraries needed to install mysql:

[root@localhost ~] # rpm-qa | grep mariadbmariadb-libs-5.5.56-2.el7.x86_64 [root@localhost ~] # rpm-e-nodeps mariadb-libs-5.5.56-2.el7.x86_64

(2) create mysql users and user groups:

[root@localhost ~] # groupadd mysql [root@localhost ~] # useradd-r-g mysql-s / bin/false mysql

(3) create MySQL installation directory and data directory:

[root@localhost ~] # mkdir / opt/mysql [root@localhost ~] # mkdir-p / data/mysql [root@localhost ~] # chown mysql:mysql / opt/mysql [root@localhost ~] # chown mysql:mysql / data/mysql

(4) install related dependencies:

[root@localhost ~] # yum install-y cmake make gcc gcc-c++ ncurses-devel openssl-devel

(4) compile and install:

[root@localhost ~] # tar-xvf mysql-boost-5.7.28.tar.gz [root@localhost mysql-5.7.28] # cmake\-DCMAKE_INSTALL_PREFIX=/opt/mysql\-DMYSQL_DATADIR=/data/mysql\-DMYSQL_USER=mysql\-DWITH_INNOBASE_STORAGE_ENGINE=1\-DWITH_ARCHIVE_STORAGE_ENGINE=1\-DWITH_BLACKHOLE_STORAGE_ENGINE=1\-DWITH_PERFSCHEMA_STORAGE_ENGINE=1\-DWITH_READLINE=1-DDOWNLOAD_BOOST=1\-DWITH_BOOST=/root/mysql-5.7 . 28/boost/boost_1_59_0/\-DMYSQL_DATADIR=/data/mysql\-DWITH_SSL= system [root @ localhost ~] # make & & make install

(5) initialize MySQL:

[root@localhost] # cd / opt/mysql/ [root@localhost mysql] #. / bin/mysqld-- initialize-- user=mysql-- basedir=/opt/mysql-- datadir=/data/mysql2019-12-01T02:33:14.303069Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use-- explicit_defaults_for_timestamp server option (see documentation for more details). 2019-12-01T02:33:16.484507Z 0 [Warning] InnoDB: New log files created, LSN=457902019-12-01T02:33:16.735058Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.2019-12-01T02:33:16.816435Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: ee34514d-13e2-11ea-b534-000c29647ed4.2019-12-01T02:33:16.818202Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.2019-12-01T02:33:17.277339Z 0 [Warning] CA certificate ca.pem is self signed.2019-12-01T02:33:17.415078Z 1 [Note] A temporary password is generated for root@localhost: og5Q0qgu6;Ui

Generate temporary password as: og5Q0qgu6;Ui

(6) modify the MySQL configuration file / etc/my.cnf to save and exit:

[root@localhost mysql] # vim / etc/ my.cnf[mysqld] datadir=/data/mysqlsocket=/data/mysql/mysql.sockuser=mysqlport=3306default-storage-engine= InnoDB[mysqld _ safe] log-error=/data/mysql/mysql-error.logpid-file=/data/mysql/ mysqld.pid[client] socket=/data/mysql/mysql.sock

(7) start MySQL:

[root@localhost mysql] # bin/mysqld_safe-- user=mysql &

(8) configure environment variables:

[root@localhost ~] # vim / etc/profile# add the following line export PATH=/opt/mysql/bin:$PATH [root@localhost ~] # source / etc/profile

(9) Log in and modify the MySQL administrator password:

[root@localhost mysql] # mysql-uroot-pEnter password:Welcome to the MySQL monitor. Commands end with; or\ g.Your MySQL connection id is 3Server version: 5.7.28Copyright (c) 2000, 2019, 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 > set password = PASSWORD ('root123456'); Query OK, 0 rows affected, 1 warning (0.00 sec)

(10) configure original login:

Mysql > grant all privileges on *. * to root@'%' identified by 'root123456';Query OK, 0 rows affected, 1 warning (0.00 sec) mysql > flush privileges

Query OK, 0 rows affected (0.00 sec)

Is there anything you don't understand about the detailed steps of installing MySQL5.7.28 source code under CentOS7.4 above? Or if you want to know more about it, you can continue to follow our industry information section.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report