服务器环境:centos7 x64
需要安装:mysql5.7+
1)检查mysql组合用户是否存在
2)若不存在,则创建mysql组和用户
对于版本选择,您可以选择以下两种方式:
[En]
For version selection, you can choose the following two ways:
1)使用Red Hat Enterprise Linux
2)使用Linux – Generic
2)百度网盘
注意:上边三种方式找mysql离线安装包的方式都可以。
设置文件及目录权限:
1)获得mysql初始密码
2)修改密码
3)验证新密码是否登录成功:
[root@localhost ~]# rpm -qa|grep mariadb mariadb-libs-5.5.68-1.el7.x86_64 [root@localhost ~]# rpm -e --nodeps mariadb-libs-5.5.68-1.el7.x86_64 [root@localhost ~]# rm /etc/my.cnf rm: cannot remove ‘/etc/my.cnf’: No such file or directory [root@localhost ~]# rpm -qa | grep mysql [root@localhost ~]# cat /etc/group | grep mysql [root@localhost ~]# cat /etc/passwd | grep mysql [root@localhost ~]# groupadd mysql [root@localhost ~]# useradd -g mysql mysql [root@localhost ~]# passwd mysql Changing password for user mysql. New password: BAD PASSWORD: The password is shorter than 8 characters Retype new password: Sorry, passwords do not match. New password: Retype new password: passwd: all authentication tokens updated successfully. [root@localhost ~]# cd /home/ [root@localhost home]# ll total 4 drwxr-xr-x. 3 root root 18 Apr 28 20:35 install drwx------. 3 mysql mysql 78 Aug 7 07:02 mysql drwx------. 15 panhusun panhusun 4096 Aug 7 06:52 panhusun drwxr-xr-x. 2 root root 6 Apr 21 01:12 server drwxr-xr-x. 4 root root 214 May 11 02:43 tar [root@localhost home]# cd tar/ [root@localhost tar]# ll total 559012 -rwxr-xr-x. 1 root root 11156 Apr 20 03:54 get_helm.sh -rw-r--r--. 1 root root 62468096 Apr 20 23:55 k3s -rw-r--r--. 1 root root 503815168 Apr 20 04:28 k3s-airgap-images-amd64.tar -rw-r--r--. 1 root root 15152 Oct 8 2021 k3s-selinux-0.4-1.el7.noarch.rpm drwxr-xr-x. 11 root root 4096 May 11 02:49 libressl-3.5.2 -rw-r--r--. 1 root root 4039407 May 11 02:43 libressl-3.5.2.tar.gz drwxr-xr-x. 14 501 games 4096 May 11 01:29 zlib-1.2.12 -rw-r--r--. 1 root root 2060528 May 11 01:58 zlib-1.2.12Upgrade.tar.gz [root@localhost tar]# pwd /home/tar [root@localhost tar]# ^C [root@localhost tar]# ll total 1209952 -rwxr-xr-x. 1 root root 11156 Apr 20 03:54 get_helm.sh -rw-r--r--. 1 root root 62468096 Apr 20 23:55 k3s -rw-r--r--. 1 root root 503815168 Apr 20 04:28 k3s-airgap-images-amd64.tar -rw-r--r--. 1 root root 15152 Oct 8 2021 k3s-selinux-0.4-1.el7.noarch.rpm drwxr-xr-x. 11 root root 4096 May 11 02:49 libressl-3.5.2 -rw-r--r--. 1 root root 4039407 May 11 02:43 libressl-3.5.2.tar.gz -rw-r--r--. 1 root root 666559924 Aug 7 07:04 mysql-5.7.36-linux-glibc2.12-x86_64.tar.gz drwxr-xr-x. 14 501 games 4096 May 11 01:29 zlib-1.2.12 -rw-r--r--. 1 root root 2060528 May 11 01:58 zlib-1.2.12Upgrade.tar.gz [root@localhost tar]# cp mysql-5.7.36-linux-glibc2.12-x86_64.tar.gz /usr/local/ [root@localhost tar]# cd /usr/local/ [root@localhost local]# ll total 650940 drwxr-xr-x. 2 root root 122 Apr 21 00:03 bin drwxr-xr-x. 2 root root 6 Apr 10 2018 etc drwxr-xr-x. 2 root root 6 Apr 10 2018 games drwxr-xr-x. 2 root root 35 May 11 02:00 include drwxr-xr-x. 2 root root 6 Apr 10 2018 lib drwxr-xr-x. 2 root root 6 Apr 10 2018 lib64 drwxr-xr-x. 2 root root 6 Apr 10 2018 libexec -rw-r--r--. 1 root root 666559924 Aug 7 07:04 mysql-5.7.36-linux-glibc2.12-x86_64.tar.gz drwxr-xr-x. 2 root root 6 Apr 10 2018 sbin drwxr-xr-x. 5 root root 49 Feb 25 19:38 share drwxr-xr-x. 2 root root 6 Apr 10 2018 src [root@localhost local]# tar -zxvf mysql-5.7.36-linux-glibc2.12-x86_64.tar.gz mysql-5.7.36-linux-glibc2.12-x86_64/bin/myisam_ftdump mysql-5.7.36-linux-glibc2.12-x86_64/bin/myisamchk mysql-5.7.36-linux-glibc2.12-x86_64/bin/myisamlog mysql-5.7.36-linux-glibc2.12-x86_64/bin/myisampack mysql-5.7.36-linux-glibc2.12-x86_64/bin/mysql mysql-5.7.36-linux-glibc2.12-x86_64/bin/mysql_client_test_embedded mysql-5.7.36-linux-glibc2.12-x86_64/bin/mysql_config_editor mysql-5.7.36-linux-glibc2.12-x86_64/bin/mysql_embedded mysql-5.7.36-linux-glibc2.12-x86_64/bin/mysql_install_db mysql-5.7.36-linux-glibc2.12-x86_64/bin/mysql_plugin mysql-5.7.36-linux-glibc2.12-x86_64/bin/mysql_secure_installation mysql-5.7.36-linux-glibc2.12-x86_64/bin/mysql_ssl_rsa_setup mysql-5.7.36-linux-glibc2.12-x86_64/bin/mysql_tzinfo_to_sql 。。。。。。 [root@localhost local]# mv mysql-5.7.36-linux-glibc2.12-x86_64 mysql [root@localhost local]# ll total 650940 drwxr-xr-x. 2 root root 122 Apr 21 00:03 bin drwxr-xr-x. 2 root root 6 Apr 10 2018 etc drwxr-xr-x. 2 root root 6 Apr 10 2018 games drwxr-xr-x. 2 root root 35 May 11 02:00 include drwxr-xr-x. 2 root root 6 Apr 10 2018 lib drwxr-xr-x. 2 root root 6 Apr 10 2018 lib64 drwxr-xr-x. 2 root root 6 Apr 10 2018 libexec drwxr-xr-x. 9 root root 129 Aug 7 07:05 mysql -rw-r--r--. 1 root root 666559924 Aug 7 07:04 mysql-5.7.36-linux-glibc2.12-x86_64.tar.gz drwxr-xr-x. 2 root root 6 Apr 10 2018 sbin drwxr-xr-x. 5 root root 49 Feb 25 19:38 share drwxr-xr-x. 2 root root 6 Apr 10 2018 src [root@localhost local]# rm -f mysql-5.7.36-linux-glibc2.12-x86_64.tar.gz [root@localhost local]# ll total 0 drwxr-xr-x. 2 root root 122 Apr 21 00:03 bin drwxr-xr-x. 2 root root 6 Apr 10 2018 etc drwxr-xr-x. 2 root root 6 Apr 10 2018 games drwxr-xr-x. 2 root root 35 May 11 02:00 include drwxr-xr-x. 2 root root 6 Apr 10 2018 lib drwxr-xr-x. 2 root root 6 Apr 10 2018 lib64 drwxr-xr-x. 2 root root 6 Apr 10 2018 libexec drwxr-xr-x. 9 root root 129 Aug 7 07:05 mysql drwxr-xr-x. 2 root root 6 Apr 10 2018 sbin drwxr-xr-x. 5 root root 49 Feb 25 19:38 share drwxr-xr-x. 2 root root 6 Apr 10 2018 src [root@localhost local]# chown -R mysql mysql/ [root@localhost local]# chgrp -R mysql mysql/ [root@localhost local]# cd mysql/ [root@localhost mysql]# mkdir data [root@localhost mysql]# chown -R mysql:mysql data [root@localhost mysql]# cd /etc/ [root@localhost etc]# ll total 1420 drwxr-xr-x. 3 root root 101 Feb 25 19:43 abrt -rw-r--r--. 1 root root 16 Feb 25 19:51 adjtime -rw-r--r--. 1 root root 1529 Mar 31 2020 aliases -rw-r--r--. 1 root root 12288 Feb 25 19:52 aliases.db drwxr-xr-x. 3 root root 65 Feb 25 19:46 alsa drwxr-xr-x. 2 root root 4096 Feb 25 19:51 alternatives -rw-------. 1 root root 541 Aug 8 2019 anacrontab -rw-r--r--. 1 root root 55 Aug 8 2019 asound.conf -rw-r--r--. 1 root root 1 Oct 30 2018 at.deny drwxr-x---. 3 root root 43 Feb 25 19:43 audisp drwxr-x---. 3 root root 83 Feb 25 19:52 audit -rw-r--r--. 1 root root 15137 Sep 30 2020 autofs.conf -rw-------. 1 root root 232 Sep 30 2020 autofs_ldap_auth.conf -rw-r--r--. 1 root root 795 Sep 30 2020 auto.master drwxr-xr-x. 2 root root 6 Sep 30 2020 auto.master.d -rw-r--r--. 1 root root 524 Sep 30 2020 auto.misc -rwxr-xr-x. 1 root root 1260 Sep 30 2020 auto.net -rwxr-xr-x. 1 root root 687 Sep 30 2020 auto.smb drwxr-xr-x. 4 root root 71 Feb 25 19:46 avahi 。。。。。。 [root@localhost etc]# touch my.cnf [root@localhost etc]# ll total 1420 drwxr-xr-x. 3 root root 101 Feb 25 19:43 abrt -rw-r--r--. 1 root root 16 Feb 25 19:51 adjtime -rw-r--r--. 1 root root 1529 Mar 31 2020 aliases -rw-r--r--. 1 root root 12288 Feb 25 19:52 aliases.db drwxr-xr-x. 3 root root 65 Feb 25 19:46 alsa drwxr-xr-x. 2 root root 4096 Feb 25 19:51 alternatives -rw-------. 1 root root 541 Aug 8 2019 anacrontab -rw-r--r--. 1 root root 55 Aug 8 2019 asound.conf -rw-r--r--. 1 root root 1 Oct 30 2018 at.deny drwxr-x---. 3 root root 43 Feb 25 19:43 audisp drwxr-x---. 3 root root 83 Feb 25 19:52 audit 。。。。。。 [root@localhost etc]# pwd /etc [root@localhost etc]# cd /usr/local/mysql/ [root@localhost mysql]# ll total 272 drwxr-xr-x. 2 mysql mysql 4096 Aug 7 07:05 bin drwxr-xr-x. 2 mysql mysql 6 Aug 7 07:06 data drwxr-xr-x. 2 mysql mysql 55 Aug 7 07:05 docs drwxr-xr-x. 3 mysql mysql 4096 Aug 7 07:05 include drwxr-xr-x. 5 mysql mysql 230 Aug 7 07:05 lib -rw-r--r--. 1 mysql mysql 259199 Sep 6 2021 LICENSE drwxr-xr-x. 4 mysql mysql 30 Aug 7 07:05 man -rw-r--r--. 1 mysql mysql 566 Sep 6 2021 README drwxr-xr-x. 28 mysql mysql 4096 Aug 7 07:05 share drwxr-xr-x. 2 mysql mysql 90 Aug 7 07:05 support-files [root@localhost mysql]# bin/mysql_install_db --user=mysql --basedir=/usr/local/mysql/ -- 2022-08-07 07:09:15 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize 2022-08-07 07:09:15 [ERROR] The data directory needs to be specified. [root@localhost mysql]# cd bin/ [root@localhost bin]# mysql_install_db --user=mysql --basedir=/usr/local/mysql/ -- bash: mysql_install_db: command not found... [root@localhost bin]# ./mysql_install_db --user=mysql --basedir=/usr/local/mysql/ -- 2022-08-07 07:09:40 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize 2022-08-07 07:09:40 [ERROR] The data directory needs to be specified. [root@localhost bin]# cd bi -bash: cd: bi: No such file or directory [root@localhost bin]# cd bin -bash: cd: bin: No such file or directory [root@localhost bin]# ll total 1348160 -rwxr-xr-x. 1 mysql mysql 8147275 Sep 7 2021 innochecksum -rwxr-xr-x. 1 mysql mysql 359769 Sep 7 2021 lz4_decompress -rwxr-xr-x. 1 mysql mysql 10101581 Sep 7 2021 myisamchk -rwxr-xr-x. 1 mysql mysql 9642658 Sep 7 2021 myisam_ftdump -rwxr-xr-x. 1 mysql mysql 7539128 Sep 7 2021 myisamlog -rwxr-xr-x. 1 mysql mysql 9769178 Sep 7 2021 myisampack -rwxr-xr-x. 1 mysql mysql 7435495 Sep 7 2021 my_print_defaults -rwxr-xr-x. 1 mysql mysql 10456480 Sep 7 2021 mysql 。。。。。。 [root@localhost bin]# ./mysqld --initialize --user=mysql 2022-08-07T14:10:55.428560Z 0 [Warning] InnoDB: New log files created, LSN=45790 2022-08-07T14:10:55.485143Z 0 [Warning] InnoDB: Creating foreign key constraint system tables. 2022-08-07T14:10:55.549898Z 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: c0c72931-165a-11ed-b15d-000c290923cd. 2022-08-07T14:10:55.552919Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened. 2022-08-07T14:10:56.502231Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher. 2022-08-07T14:10:56.502306Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher. 2022-08-07T14:10:56.504364Z 0 [Warning] CA certificate ca.pem is self signed. 2022-08-07T14:10:56.740944Z 1 [Note] A temporary password is generated for root@localhost: ?dV?_49?hc.f [root@localhost bin]# pwd /usr/local/mysql/bin [root@localhost bin]# bin/mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/ -bash: bin/mysql_install_db: No such file or directory [root@localhost bin]# ./bin/mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/ -bash: ./bin/mysql_install_db: No such file or directory [root@localhost bin]# sh bin/mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data sh: bin/mysql_install_db: No such file or directory [root@localhost bin]# ./mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data 2022-08-07 07:12:36 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize 2022-08-07 07:12:36 [ERROR] The data directory '/usr/local/mysql/data' already exist and is not empty. [root@localhost bin]# rm -rf /usr/local/mysql/data/ [root@localhost bin]# ./mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data 2022-08-07 07:13:23 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize 2022-08-07 07:13:27 [WARNING] The bootstrap log isn't empty: 2022-08-07 07:13:27 [WARNING] 2022-08-07T14:13:23.279025Z 0 [Warning] --bootstrap is deprecated. Please consider using --initialize instead 2022-08-07T14:13:23.279659Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000) 2022-08-07T14:13:23.279668Z 0 [Warning] Changed limits: table_open_cache: 407 (requested 2000) [root@localhost bin]# cd ../ [root@localhost mysql]# ll total 276 drwxr-xr-x. 2 mysql mysql 4096 Aug 7 07:05 bin drwxr-x---. 5 mysql mysql 4096 Aug 7 07:13 data drwxr-xr-x. 2 mysql mysql 55 Aug 7 07:05 docs drwxr-xr-x. 3 mysql mysql 4096 Aug 7 07:05 include drwxr-xr-x. 5 mysql mysql 230 Aug 7 07:05 lib -rw-r--r--. 1 mysql mysql 259199 Sep 6 2021 LICENSE drwxr-xr-x. 4 mysql mysql 30 Aug 7 07:05 man -rw-r--r--. 1 mysql mysql 566 Sep 6 2021 README drwxr-xr-x. 28 mysql mysql 4096 Aug 7 07:05 share drwxr-xr-x. 2 mysql mysql 90 Aug 7 07:05 support-files [root@localhost mysql]# cp ./support-files/mysql.server /etc/init.d/mysqld [root@localhost mysql]# chown 777 my.cnf chown: cannot access ‘my.cnf’: No such file or directory [root@localhost mysql]# chown 777 /etc/my.cnf [root@localhost mysql]# /etc/init.d/mysqld restart ERROR! MySQL server PID file could not be found! Starting MySQL.Logging to '/usr/local/mysql/data/localhost.localdomain.err'. 2022-08-07T14:14:23.991592Z mysqld_safe Directory '/var/lib/mysql' for UNIX socket file don't exists. ERROR! The server quit without updating PID file (/usr/local/mysql/data/localhost.localdomain.pid). [root@localhost mysql]# mysql]# ps aux|grep mysql bash: mysql]#: command not found... [root@localhost mysql]# ps aux|grep mysql root 14366 0.0 0.0 112808 964 pts/1 R+ 07:15 0:00 grep --color=auto mysql [root@localhost mysql]# kill -9 14366 -bash: kill: (14366) - No such process [root@localhost mysql]# /usr/local/mysql/bin/mysqld_safe: line 198: 32684 Killed nohup /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=CDH-141.err --pid-file=/usr/local/mysql/data/CDH-141.pid --port=3323 < /dev/null > /dev/null 2>&1 [root@localhost mysql]# ps aux|grep mysql root 14670 0.0 0.0 112808 968 pts/1 S+ 07:15 0:00 grep --color=auto mysql [root@localhost mysql]# /etc/init.d/mysqld restart ERROR! MySQL server PID file could not be found! Starting MySQL.Logging to '/usr/local/mysql/data/localhost.localdomain.err'. 2022-08-07T14:15:57.588824Z mysqld_safe Directory '/var/lib/mysql' for UNIX socket file don't exists. ERROR! The server quit without updating PID file (/usr/local/mysql/data/localhost.localdomain.pid). [root@localhost mysql]# service mysqld start Starting MySQL.Logging to '/usr/local/mysql/data/localhost.localdomain.err'. 2022-08-07T14:16:30.536032Z mysqld_safe Directory '/var/lib/mysql' for UNIX socket file don't exists. ERROR! The server quit without updating PID file (/usr/local/mysql/data/localhost.localdomain.pid). [root@localhost mysql]# cat /usr/local/mysql/data/localhost.localdomain.err cat: /usr/local/mysql/data/localhost.localdomain.err: No such file or directory [root@localhost mysql]# cd /usr/local/mysql/data/ [root@localhost data]# ll total 110660 -rw-r-----. 1 mysql mysql 56 Aug 7 07:13 auto.cnf -rw-------. 1 mysql mysql 1676 Aug 7 07:13 ca-key.pem -rw-r--r--. 1 mysql mysql 1112 Aug 7 07:13 ca.pem -rw-r--r--. 1 mysql mysql 1112 Aug 7 07:13 client-cert.pem -rw-------. 1 mysql mysql 1676 Aug 7 07:13 client-key.pem -rw-r-----. 1 mysql mysql 436 Aug 7 07:13 ib_buffer_pool -rw-r-----. 1 mysql mysql 12582912 Aug 7 07:13 ibdata1 -rw-r-----. 1 mysql mysql 50331648 Aug 7 07:13 ib_logfile0 -rw-r-----. 1 mysql mysql 50331648 Aug 7 07:13 ib_logfile1 drwxr-x---. 2 mysql mysql 4096 Aug 7 07:13 mysql drwxr-x---. 2 mysql mysql 8192 Aug 7 07:13 performance_schema -rw-------. 1 mysql mysql 1676 Aug 7 07:13 private_key.pem -rw-r--r--. 1 mysql mysql 452 Aug 7 07:13 public_key.pem -rw-r--r--. 1 mysql mysql 1112 Aug 7 07:13 server-cert.pem -rw-------. 1 mysql mysql 1680 Aug 7 07:13 server-key.pem drwxr-x---. 2 mysql mysql 8192 Aug 7 07:13 sys [root@localhost data]# chown -R mysql:mysql /var/lib/mysql chown: cannot access ‘/var/lib/mysql’: No such file or directory [root@localhost data]# mkdir -p /var//lib/mysql [root@localhost data]# chown -R mysql:mysql /var/lib/mysql [root@localhost data]# systemctl start mysql Failed to start mysql.service: Unit not found. [root@localhost data]# systemctl start mysqld Failed to start mysqld.service: Unit not found. [root@localhost data]# service mysqld start Starting MySQL.Logging to '/usr/local/mysql/data/localhost.localdomain.err'. SUCCESS! [root@localhost data]# chkconfig --level 35 mysqld on [root@localhost data]# chkconfig --list mysqld Note: This output shows SysV services only and does not include native systemd services. SysV configuration data might be overridden by native systemd configuration. If you want to list systemd services use 'systemctl list-unit-files'. To see services enabled on particular target use 'systemctl list-dependencies [target]'. mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off [root@localhost data]# service mysqld status SUCCESS! MySQL running (16587) [root@localhost data]# vim /etc/profile [root@localhost data]# source /etc/profile [root@localhost data]# cat /root/.mysql_secret # Password set for user 'root@localhost' at 2022-08-07 07:13:23 SBjo&twpMd>K [root@localhost data]# mysql -uroot -p Enter password: mysql: Character set 'utf8-mb4' is not a compiled character set and is not specified in the '/usr/local/mysql/share/charsets/Index.xml' file mysql: Character set 'utf8-mb4' is not a compiled character set and is not specified in the '/usr/local/mysql/share/charsets/Index.xml' file ERROR 2019 (HY000): Can't initialize character set utf8-mb4 (path: /usr/local/mysql/share/charsets/) [root@localhost data]# vim /etc/my.cnf [root@localhost data]# systemctl restart mysql [root@localhost data]# mysql -uroot -p Enter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) [root@localhost data]# mysql -uroot -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 7 Server version: 5.7.36 Copyright (c) 2000, 2021, Oracle and/or its affiliates. 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> set PASSWORD = PASSWORD('MGuoDu2022'); Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql>exit; Bye
[root@localhost data]# mysql -uroot -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 9 Server version: 5.7.36 MySQL Community Server (GPL) Copyright (c) 2000, 2021, Oracle and/or its affiliates. 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> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'MGuoDu2022' WITH GRANT OPTION; Query OK, 0 rows affected, 1 warning (0.06 sec) mysql> select host,user from user; ERROR 1046 (3D000): No database selected mysql> service mysqld restart mysql> exit; Bye [root@localhost data]# service mysqld restart Shutting down MySQL.. SUCCESS! Starting MySQL. SUCCESS! [root@localhost data]# systemctl status firewalld ● firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled) Active: active (running) since Sun 2022-08-07 06:50:58 PDT; 39min ago Docs: man:firewalld(1) Main PID: 696 (firewalld) Tasks: 2 Memory: 10.6M CGroup: /system.slice/firewalld.service └─696 /usr/bin/python2 -Es /usr/sbin/firewalld --nofork --nopid Aug 07 06:50:57 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon... Aug 07 06:50:58 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon. Aug 07 06:50:58 localhost.localdomain firewalld[696]: WARNING: AllowZoneDrifting is enabled. This is considered an insec... now. Hint: Some lines were ellipsized, use -l to show in full. [root@localhost data]# [root@localhost data]# firewall-cmd --permanent --add-port=3506/tcp success [root@localhost data]# [root@localhost data]# firewall-cmd --reload success [root@localhost data]# vim /etc/my.cnf [root@localhost data]# systemctl restart mysql [root@localhost data]#
Original: https://www.cnblogs.com/JimmyThomas/p/16571278.html
Author: JimmyThomas
Title: Centos7环境使用Mysql离线安装包安装Mysql5.7
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/505060/
转载文章受原作者版权保护。转载请注明原作者出处!