In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
1 describes that OEL7.2 x64 uses minimal installation by default. On this basis, install mysql 5.7.22 source code.
(the version to be used for mysql-8.0.11 cmake is at least 2.8.12, while the version of OEL7.2 cmake is 2.8.11. If you need to use the cmake on CD-ROM, you need to upgrade the system version)
Mysql service startup and shutdown is managed by systemd, and the parameter-DWITH_SYSTEMD=1 is enabled at compile time
2 operating environment 2.1 OS infoOEL7.2 x64
2.2 Other prerequisite package:
Cmake
Make
Gcc-c++
Boost (You can download it when execute cmake with-DDOWNLOAD_BOOST=1-DWITH_BOOST=, or download it from https://sourceforge.net/projects/boost/files/boost/1.59.0/)
Ncurses-devel
Perl
Bison
3 process design shell > yum-Q-y install cmake make gcc-c++ ncurses-devel perl bison
# Preconfiguration setup
Shell > groupadd mysql
Shell > useradd-r-g mysql-s / bin/false mysql
# Beginning of source-build specific instructions
Shell > tar zxvf mysql-VERSION.tar.gz
Shell > cd mysql-VERSION
Shell > mkdir bld
Shell > cd bld
# shell > cmake.. -DDOWNLOAD_BOOST=1-DWITH_BOOST=/usr/local/
# shell > cmake.. -DWITH_BOOST=/usr/local/boost_1_59_0
Shell > cmake.. -DWITH_BOOST=/usr/local/boost_1_59_0-DWITH_SYSTEMD=1
Shell > make-j 4
Shell > make install
# End of source-build specific instructions
# Postinstallation setup
Shell > cd / usr/local/mysql
Shell > bin/mysqld-- initialize-- user=mysql
# shell > bin/mysql_install_db-user=mysql-basedir=/opt/mysql/mysql-datadir=/opt/mysql/mysql/data
Shell > cp / usr/local/mysql/usr/lib/systemd/system/mysqld* / usr/lib/systemd/system/
Shell > systemctl daemon-reload
Shell > systemctl enable mysqld.service
Shell > mkdir / var/run/mysqld/
Shell > chown mysql:mysql / var/run/mysqld/
Shell > systemctl restart mysqld.service
4 detailed steps to operate shell > cmake.. -DWITH_BOOST=/usr/local/boost_1_59_0-DWITH_SYSTEMD=1
A brief introduction to the installation and compilation process
# Postinstallation setup
[root@localhost bld] # cd / usr/local/mysql/
[root@localhost mysql] # bin/mysqld-initialize-user=mysql
2018-05-02T19:06:52.849013Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use-explicit_defaults_for_timestamp server option (see documentation for more details).
2018-05-02T19:06:56.156730Z 0 [Warning] InnoDB: New log files created, LSN=45790
2018-05-02T19:06:56.428913Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2018-05-02T19:06:56.531465Z 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: fb8f5e7d-4e3b-11e8-bd58-000c29a3197b.
2018-05-02T19:06:56.540768Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2018-05-02T19:06:56.542462Z 1 [Note] A temporary password is generated for root@localhost: 4Elym djimi muri hnvhtk
[root@localhost mysql] # bin/mysql-uroot-p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket'/ tmp/mysql.sock' (2)
[root@localhost mysql] # cp / usr/local/mysql/usr/lib/systemd/system/mysqld* / usr/lib/systemd/system/
[root@localhost mysql] # systemctl daemon-reload
[root@localhost mysql] # systemctl enable mysqld.service
Created symlink from / etc/systemd/system/multi-user.target.wants/mysqld.service to / usr/lib/systemd/system/mysqld.service.
[root@localhost mysql] # mkdir / var/run/mysqld/
[root@localhost mysql] # chown-R mysql / var/run/mysqld/
[root@localhost mysql] # systemctl restart mysqld.service
[root@localhost mysql] # bin/mysql-uroot-p
Enter password:
Welcome to the MySQL monitor. Commands end with; or\ g.
Your MySQL connection id is 2
Server version: 5.7.22
Copyright (c) 2000, 2018, 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 > ALTER USER 'root'@'localhost' IDENTIFIED BY' root'
Query OK, 0 rows affected (0.00 sec)
Mysql > exit
Bye
[root@localhost mysql] # ps-ef | grep mysql
Mysql 21993 10 03:10? 00:00:00 / usr/local/mysql/bin/mysqld-daemonize-pid-file=/var/run/mysqld/mysqld.pid
Root 22024 2427 0 03:14 pts/0 00:00:00 grep-color=auto mysql
[root@localhost mysql] # systemctl stop mysqld.service
5 personal summary a.make-j
-j [N],-- jobs [= N] Allow N jobs at once; infinite jobs with no arg.
I didn't put a number after-j to limit the number of job. As a result, both compilations caused the system to report an outofmemory error. Numerical value and the number of cpu equivalent effect is the best.
For optional parameters when compiling b.cmake, please refer to https://dev.mysql.com/doc/refman/5.7/en/source-configuration-options.html
c. If the system is already connected to the public network, boost can open the download parameter-DDOWNLOAD_BOOST=1 during cmake.
D.systemd call file
When the systemd parameter-DWITH_SYSTEMD=1 is enabled for cmake, a corresponding mysqld.service file that can be called by systemd is generated. The contents of the document are as follows:
[root@localhost system] # ls / usr/local/mysql/usr/lib/systemd/system/
Mysqld.service mysqld@.service
[root@localhost system] # grep-v ^ # mysqld.service | grep-v ^ $
[Unit]
Description=MySQL Server
Documentation=man:mysqld (8)
Documentation= http://dev.mysql.com/doc/refman/en/using-systemd.html
After=network.target
After=syslog.target
[Install]
WantedBy=multi-user.target
[Service]
User=mysql
Group=mysql
Type=forking
PIDFile=/var/run/mysqld/mysqld.pid
TimeoutSec=0
PermissionsStartOnly=true
ExecStartPre=/usr/local/mysql/bin/mysqld_pre_systemd
ExecStart=/usr/local/mysql/bin/mysqld-daemonize-pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS
EnvironmentFile=-/etc/sysconfig/mysql
LimitNOFILE = 5000
Restart=on-failure
RestartPreventExitStatus=1
PrivateTmp=false
[root@localhost system] # grep-v ^ # mysqld@.service | grep-v ^ $
[Unit]
Description=MySQL Server
Documentation=man:mysqld (8)
Documentation= http://dev.mysql.com/doc/refman/en/using-systemd.html
After=network.target
After=syslog.target
[Install]
WantedBy=multi-user.target
[Service]
User=mysql
Group=mysql
Type=forking
PIDFile=/var/run/mysqld/mysqld-%i.pid
TimeoutSec=0
PermissionsStartOnly=true
ExecStartPre=/usr/local/mysql/bin/mysqld_pre_systemd I
ExecStart=/usr/local/mysql/bin/mysqld-defaults-group-suffix=@%I-daemonize-pid-file=/var/run/mysqld/mysqld-%i.pid $MYSQLD_OPTS
EnvironmentFile=-/etc/sysconfig/mysql
LimitNOFILE = 5000
Restart=on-failure
RestartPreventExitStatus=1
PrivateTmp=false
[root@localhost system] #
Add mysqld.service and mysqld@.service copy to the operating system / usr/lib/systemd/system/ directory, and then reload daemon.
Note that the directory / var/run/mysqld/ of pid-file needs to exist and the directory permission is mysql, otherwise an error will be started. The / var/run/mysqld directory will disappear automatically after the system is rebooted. It is recommended to place the pid-file file in the permanent directory of the mysql user.
6 references to https://dev.mysql.com/doc/refman/5.7/en/source-installation.html
Https://dev.mysql.com/doc/refman/5.7/en/using-systemd.html
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.