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

The process of installing mysql5.7.25 in centos7 binary

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "the process of installing mysql5.7.25 in centos7 binary system". In daily operation, I believe that many people have doubts about the process of installing mysql5.7.25 in centos7 binary system. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "centos7 binary installation mysql5.7.25 process". Next, please follow the editor to study!

one。 Pre-installation system environment check

1. Close selinux

[root@mgr1] # cat / etc/sysconfig/selinux# This file controls the state of SELinux on the system.# SELINUX= can take one of these three values:# enforcing-SELinux security policy is enforced.# permissive-SELinux prints warnings instead of enforcing.# disabled-No SELinux policy is loaded.SELINUX=disabled# SELINUXTYPE= can take one of three values:# targeted-Targeted processes are protected,# minimum-Modification of targeted policy. Only selected processes are protected. # mls-Multi Level Security protection.SELINUXTYPE=targeted

two。 Turn off the firewall

[root@mgr1 ~] # systemctl stop firewalld [root@mgr1 ~] # systemctl status firewalld ● firewalld.service-firewalld-dynamic firewall daemon Loaded: loaded (/ usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled) Active: inactive (dead) since Sat 2019-02-16 19:12:54 EST 8s ago Docs: man:firewalld (1) Process: 7054 ExecStart=/usr/sbin/firewalld-- nofork-- nopid $FIREWALLD_ARGS (code=exited, status=0/SUCCESS) Main PID: 7054 (code=exited Status=0/SUCCESS) Feb 16 08:46:31 mgr1 systemd [1]: Starting firewalld-dynamic firewall daemon...Feb 16 08:46:33 mgr1 systemd [1]: Started firewalld-dynamic firewall daemon.Feb 16 19:12:52 mgr1 systemd [1]: Stopping firewalld-dynamic firewall daemon...Feb 16 19:12:54 mgr1 systemd [1]: Stopped firewalld-dynamic firewall daemon.

3.centos 7 io scheduling system is in deadline mode, and ssd hard disk needs to be changed to noop mode.

[root@mgr1 ~] # cat / sys/block/sda/queue/schedulernoop [deadline] cfq

4. Operating system limitations

[root@mgr1 default] # ulimit-acore file size (blocks,-c) 0data seg size (kbytes,-d) unlimitedscheduling priority (- e) 0file size (blocks,-f) unlimitedpending signals (- I) 3795max locked memory (kbytes,-l) 64max memory size (kbytes -m) unlimitedopen files (- n) 1024pipe size (512 bytes,-p) 8POSIX message queues (bytes,-Q) 819200real-time priority (- r) 0stack size (kbytes,-s) 8192cpu time (seconds,-t) unlimitedmax user processes (- u) 3795virtual memory (kbytes -v) unlimitedfile locks (- x) unlimited

The two most important parameters are open files and max user processes

Edit / etc/security/limits.conf and add the following

* soft nproc 65535 * hard nproc 65535 * soft nofile 65535 * hard nofile 65535

5.numa

6. Create user groups and users

[root@mgr1 default] # groupadd mysql [root@mgr1 default] # [root@mgr1 default] # useradd-g mysql mysql-s / sbin/nologin [root@mgr1 default] #

7. Make a soft connection

[root@mgr1 default] # cd / usr/local [root@mgr1 local] # ls-ltrtotal 0drwxr-xr-x. 2 root root 6 Apr 11 2018 srcdrwxr-xr-x. 2 root root 6 Apr 11 2018 sbindrwxr-xr-x. 2 root root 6 Apr 11 2018 libexecdrwxr-xr-x. 2 root root 6 Apr 11 2018 lib64drwxr-xr-x. 2 root root 6 Apr 11 2018 libdrwxr-xr-x. 2 root root 6 Apr 11 2018 includedrwxr-xr-x. 2 root root 6 Apr 11 2018 gamesdrwxr-xr-x. 2 root root 6 Apr 11 2018 etcdrwxr-xr-x. 2 root root 6 Apr 11 2018 bindrwxr-xr-x. 5 root root 49 Feb 16 08:30 sharedrwxr-xr-x. 9 root root 129 Feb 16 18:58 mysql-5.7.25-linux-glibc2.12-i686 [root@mgr1 local] # ln-s mysql-5.7.25-linux-glibc2.12-i686 mysql

8. Authorization

[root@mgr1 local] # chown mysql:mysql-R mysql

9. Create a data directory for the mysql database (datadir)

[root@mgr1 /] # mkdir-p / data/mysql

10. Authorize the data directory

[root@mgr1 /] # chown-R mysql:mysql / data/mysql

11. Configuration / etc/my.cnf file

[client] port=3306socket=/usr/local/mysql/ mysql.sock [MySQL] prompt= "\ u@db\ R:\ m:\ s [\ d] >" no-auto- Rehash [mysqld] user=mysqlport=3306socket=/usr/local/mysql/mysql.sockserver_id=20gtid_mode=onenforce_gtid_consistency=onmaster_info_repository=tablerelay_log_info_repository=tablebinlog_checksum=nonelog_slave_updates=onlog-bin=/usr/local/mysql/log/mysql-binbinlog_format=rowbasedir=/usr/local/mysqldatadir=/data/mysqlperformance_schema=1character-set-server=utf8collation-server=utf8_binlog_ Timestamps=systemexplicit_defaults_for_timestamp=true####group replicationtransaction_write_set_extraction = XXHASH64loose-group_replication_group_name = 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb'loose-group_replication_start_on_boot = offloose-group_replication_local_address =' 192.168.44.132:33061'loose-group_replication_group_seeds = '192.168.44.132:33061192.168.44.133:33061192.168.44.134:33061'loose-group_replication_bootstrap_group = off

twelve。 Initialization

[root@mgr1 bin] # / mysqld-- defaults-file=/etc/my.cnf-- basedir=/usr/local/mysql-- datadir=/data/mysql/-- user=mysql-- initialize

-bash:. / mysqld: / lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

Solution:

[root@mgr1 bin] # yum install glibc.i686

[root@mgr1 bin] # / mysqld-- defaults-file=/etc/my.cnf-- basedir=/usr/local/mysql-- datadir=/data/mysql/-- user=mysql-- initialize

. / mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory

Solution:

Yum-y install libaio.so.1

[root@mgr1 bin] # / mysqld-- defaults-file=/etc/my.cnf-- basedir=/usr/local/mysql-- datadir=/data/mysql/-- user=mysql-- initialize

. / mysqld: error while loading shared libraries: libnuma.so.1: cannot open shared object file: No such file or directory

Yum install-y libnuma.so.1

[root@mgr1 bin] # / mysqld-- defaults-file=/etc/my.cnf-- basedir=/usr/local/mysql-- datadir=/data/mysql/-- user=mysql-- initialize

. / mysqld: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

Yum install-y libstdc++.so.6

[root@mgr1 bin] # / mysqld-- defaults-file=/etc/my.cnf-- basedir=/usr/local/mysql-- datadir=/data/mysql/-- user=mysql-- initialize

Start:

[root@mgr1 bin] # / mysqld_safe-- defaults-file=/etc/my.cnf &

[1] 7910

[root@mgr1 bin] # 2019-02-17T07:47:24.044846Z mysqld_safe Logging to'/ data/mysql/error.log'.

2019-02-17T07:47:24.109848Z mysqld_safe Starting mysqld daemon with databases from / data/mysql

2019-02-17T07:47:26.264358Z mysqld_safe mysqld from pid file / data/mysql/mgr1.pid ended

View the initialization password:

[root@mgr1 bin] # cat / data/mysql/error.log | grep password

2019-02-17T03:06:47.347886-05:00 1 [Note] A temporary password is generated for root@localhost: vjxL1c_F3*fd

Login:

[root@mgr1 bin] #. / mysql-uroot-p

Change the password:

Root@db 03:10: [(none)] > set password='root123'

Query OK, 0 rows affected (0.00 sec)

Root@db 03:12: [(none)] > alter user 'root'@'localhost' password expire never

Query OK, 0 rows affected (0.00 sec)

Root@db 03:13: [(none)] > flush privileges

Query OK, 0 rows affected (0.00 sec)

Set environment variabl

Export PATH=$PATH:/usr/local/mysql/bin

Make it work.

Source / etc/profile

At this point, the study of "the process of installing mysql5.7.25 in centos7 binary system" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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