From 43e300131f136186fa7e65cbbddd550c290cc687 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9C=8D=E6=BA=90=E6=B5=A9?= <11100782+huoyuanhao@user.noreply.gitee.com> Date: Sun, 2 Oct 2022 08:00:41 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20huoyunahao?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- huoyunahao/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 huoyunahao/.keep diff --git a/huoyunahao/.keep b/huoyunahao/.keep new file mode 100644 index 0000000..e69de29 -- Gitee From ce476dd23453797e7d11f06825c7fead3a5ec093 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9C=8D=E6=BA=90=E6=B5=A9?= <11100782+huoyuanhao@user.noreply.gitee.com> Date: Sun, 2 Oct 2022 08:03:02 +0000 Subject: [PATCH 2/2] add huoyunahao/MySQL.txt. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 霍源浩 <> --- huoyunahao/MySQL.txt | 298 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 298 insertions(+) create mode 100644 huoyunahao/MySQL.txt diff --git a/huoyunahao/MySQL.txt b/huoyunahao/MySQL.txt new file mode 100644 index 0000000..39ac871 --- /dev/null +++ b/huoyunahao/MySQL.txt @@ -0,0 +1,298 @@ +[root@iZbp1h9iqx6mxctz3vuj04Z ~]# cat /etc/os-release +NAME="Anolis OS" +VERSION="8.2" +ID="anolis" +ID_LIKE="rhel fedora centos" +VERSION_ID="8.2" +PLATFORM_ID="platform:an8" +PRETTY_NAME="Anolis OS 8.2" +ANSI_COLOR="0;31" +HOME_URL="https://openanolis.cn/" + +[root@iZbp1h9iqx6mxctz3vuj04Z ~]# uname -r +4.19.91-25.8.an8.x86_64 +[root@iZbp1h9iqx6mxctz3vuj04Z ~]# yum install mysql-server -y +Repository epel is listed more than once in the configuration +AnolisOS-8 - AppStream 32 MB/s | 7.7 MB 00:00 +AnolisOS-8 - BaseOS 6.6 MB/s | 2.4 MB 00:00 +AnolisOS-8 - PowerTools 14 MB/s | 1.8 MB 00:00 +Dependencies resolved. +===================================================================================================================================================================== + Package Architecture Version Repository Size +===================================================================================================================================================================== +Installing: + mysql-server x86_64 8.0.26-1.0.1.module+an8.4.0+10570+ea0623f5 AppStream 25 M +Upgrading: + audit x86_64 3.0.7-2.an8.2 BaseOS 262 k + audit-libs x86_64 3.0.7-2.an8.2 BaseOS 122 k + libsemanage x86_64 2.9-8.an8 BaseOS 167 k + policycoreutils x86_64 2.9-19.an8 BaseOS 373 k +Installing dependencies: + checkpolicy x86_64 2.9-1.el8 BaseOS 345 k + libaio x86_64 0.3.112-1.el8 BaseOS 31 k + mariadb-connector-c-config noarch 3.1.11-2.an8 AppStream 14 k + mecab x86_64 0.996-1.module+an8.4.0+10570+ea0623f5.9 AppStream 392 k + mysql x86_64 8.0.26-1.0.1.module+an8.4.0+10570+ea0623f5 AppStream 12 M + mysql-common x86_64 8.0.26-1.0.1.module+an8.4.0+10570+ea0623f5 AppStream 133 k + mysql-errmsg x86_64 8.0.26-1.0.1.module+an8.4.0+10570+ea0623f5 AppStream 597 k + policycoreutils-python-utils noarch 2.9-19.an8 BaseOS 252 k + protobuf-lite x86_64 3.5.0-13.an8 AppStream 147 k + python3-audit x86_64 3.0.7-2.an8.2 BaseOS 86 k + python3-libsemanage x86_64 2.9-8.an8 BaseOS 127 k + python3-policycoreutils noarch 2.9-19.an8 BaseOS 2.2 M + python3-setools x86_64 4.3.0-3.an8 BaseOS 623 k +Enabling module streams: + mysql 8.0 + +Transaction Summary +===================================================================================================================================================================== +Install 14 Packages +Upgrade 4 Packages + +Total download size: 43 M +Downloading Packages: +(1/18): mariadb-connector-c-config-3.1.11-2.an8.noarch.rpm 286 kB/s | 14 kB 00:00 +(2/18): mecab-0.996-1.module+an8.4.0+10570+ea0623f5.9.x86_64.rpm 3.5 MB/s | 392 kB 00:00 +(3/18): mysql-errmsg-8.0.26-1.0.1.module+an8.4.0+10570+ea0623f5.x86_64.rpm 7.0 MB/s | 597 kB 00:00 +(4/18): mysql-8.0.26-1.0.1.module+an8.4.0+10570+ea0623f5.x86_64.rpm 31 MB/s | 12 MB 00:00 +(5/18): mysql-common-8.0.26-1.0.1.module+an8.4.0+10570+ea0623f5.x86_64.rpm 383 kB/s | 133 kB 00:00 +(6/18): protobuf-lite-3.5.0-13.an8.x86_64.rpm 3.8 MB/s | 147 kB 00:00 +(7/18): checkpolicy-2.9-1.el8.x86_64.rpm 6.7 MB/s | 345 kB 00:00 +(8/18): libaio-0.3.112-1.el8.x86_64.rpm 1.0 MB/s | 31 kB 00:00 +(9/18): policycoreutils-python-utils-2.9-19.an8.noarch.rpm 5.3 MB/s | 252 kB 00:00 +(10/18): python3-audit-3.0.7-2.an8.2.x86_64.rpm 1.8 MB/s | 86 kB 00:00 +(11/18): python3-libsemanage-2.9-8.an8.x86_64.rpm 3.7 MB/s | 127 kB 00:00 +(12/18): python3-policycoreutils-2.9-19.an8.noarch.rpm 21 MB/s | 2.2 MB 00:00 +(13/18): python3-setools-4.3.0-3.an8.x86_64.rpm 6.8 MB/s | 623 kB 00:00 +(14/18): audit-3.0.7-2.an8.2.x86_64.rpm 5.9 MB/s | 262 kB 00:00 +(15/18): audit-libs-3.0.7-2.an8.2.x86_64.rpm 3.2 MB/s | 122 kB 00:00 +(16/18): mysql-server-8.0.26-1.0.1.module+an8.4.0+10570+ea0623f5.x86_64.rpm 37 MB/s | 25 MB 00:00 +(17/18): libsemanage-2.9-8.an8.x86_64.rpm 707 kB/s | 167 kB 00:00 +(18/18): policycoreutils-2.9-19.an8.x86_64.rpm 1.4 MB/s | 373 kB 00:00 +--------------------------------------------------------------------------------------------------------------------------------------------------------------------- +Total 46 MB/s | 43 MB 00:00 +Running transaction check +Transaction check succeeded. +Running transaction test +Transaction test succeeded. +Running transaction + Preparing : 1/1 + Running scriptlet: audit-libs-3.0.7-2.an8.2.x86_64 1/1 + Upgrading : audit-libs-3.0.7-2.an8.2.x86_64 1/22 + Upgrading : libsemanage-2.9-8.an8.x86_64 2/22 + Installing : mariadb-connector-c-config-3.1.11-2.an8.noarch 3/22 + Installing : mysql-common-8.0.26-1.0.1.module+an8.4.0+10570+ea0623f5.x86_64 4/22 + Installing : mysql-8.0.26-1.0.1.module+an8.4.0+10570+ea0623f5.x86_64 5/22 + Installing : mysql-errmsg-8.0.26-1.0.1.module+an8.4.0+10570+ea0623f5.x86_64 6/22 + Installing : python3-libsemanage-2.9-8.an8.x86_64 7/22 + Upgrading : policycoreutils-2.9-19.an8.x86_64 8/22 + Running scriptlet: policycoreutils-2.9-19.an8.x86_64 8/22 + Installing : python3-audit-3.0.7-2.an8.2.x86_64 9/22 + Installing : python3-setools-4.3.0-3.an8.x86_64 10/22 + Installing : libaio-0.3.112-1.el8.x86_64 11/22 + Installing : checkpolicy-2.9-1.el8.x86_64 12/22 + Installing : python3-policycoreutils-2.9-19.an8.noarch 13/22 + Installing : policycoreutils-python-utils-2.9-19.an8.noarch 14/22 + Installing : protobuf-lite-3.5.0-13.an8.x86_64 15/22 + Installing : mecab-0.996-1.module+an8.4.0+10570+ea0623f5.9.x86_64 16/22 + Running scriptlet: mecab-0.996-1.module+an8.4.0+10570+ea0623f5.9.x86_64 16/22 + Running scriptlet: mysql-server-8.0.26-1.0.1.module+an8.4.0+10570+ea0623f5.x86_64 17/22 + Installing : mysql-server-8.0.26-1.0.1.module+an8.4.0+10570+ea0623f5.x86_64 17/22 + Running scriptlet: mysql-server-8.0.26-1.0.1.module+an8.4.0+10570+ea0623f5.x86_64 17/22 +ValueError: File context for /var/log/mysql(/.*)? already defined + + Upgrading : audit-3.0.7-2.an8.2.x86_64 18/22 + Running scriptlet: audit-3.0.7-2.an8.2.x86_64 18/22 + Running scriptlet: policycoreutils-2.9-16.0.1.an8.x86_64 19/22 + Cleanup : policycoreutils-2.9-16.0.1.an8.x86_64 19/22 + Running scriptlet: audit-3.0-0.17.20191104git1c2f876.el8.x86_64 20/22 + Cleanup : audit-3.0-0.17.20191104git1c2f876.el8.x86_64 20/22 + Running scriptlet: audit-3.0-0.17.20191104git1c2f876.el8.x86_64 20/22 + Cleanup : libsemanage-2.9-6.an8.x86_64 21/22 + Cleanup : audit-libs-3.0-0.17.20191104git1c2f876.el8.x86_64 22/22 + Running scriptlet: audit-libs-3.0-0.17.20191104git1c2f876.el8.x86_64 22/22 + Verifying : mariadb-connector-c-config-3.1.11-2.an8.noarch 1/22 + Verifying : mecab-0.996-1.module+an8.4.0+10570+ea0623f5.9.x86_64 2/22 + Verifying : mysql-8.0.26-1.0.1.module+an8.4.0+10570+ea0623f5.x86_64 3/22 + Verifying : mysql-common-8.0.26-1.0.1.module+an8.4.0+10570+ea0623f5.x86_64 4/22 + Verifying : mysql-errmsg-8.0.26-1.0.1.module+an8.4.0+10570+ea0623f5.x86_64 5/22 + Verifying : mysql-server-8.0.26-1.0.1.module+an8.4.0+10570+ea0623f5.x86_64 6/22 + Verifying : protobuf-lite-3.5.0-13.an8.x86_64 7/22 + Verifying : checkpolicy-2.9-1.el8.x86_64 8/22 + Verifying : libaio-0.3.112-1.el8.x86_64 9/22 + Verifying : policycoreutils-python-utils-2.9-19.an8.noarch 10/22 + Verifying : python3-audit-3.0.7-2.an8.2.x86_64 11/22 + Verifying : python3-libsemanage-2.9-8.an8.x86_64 12/22 + Verifying : python3-policycoreutils-2.9-19.an8.noarch 13/22 + Verifying : python3-setools-4.3.0-3.an8.x86_64 14/22 + Verifying : audit-3.0.7-2.an8.2.x86_64 15/22 + Verifying : audit-3.0-0.17.20191104git1c2f876.el8.x86_64 16/22 + Verifying : audit-libs-3.0.7-2.an8.2.x86_64 17/22 + Verifying : audit-libs-3.0-0.17.20191104git1c2f876.el8.x86_64 18/22 + Verifying : libsemanage-2.9-8.an8.x86_64 19/22 + Verifying : libsemanage-2.9-6.an8.x86_64 20/22 + Verifying : policycoreutils-2.9-19.an8.x86_64 21/22 + Verifying : policycoreutils-2.9-16.0.1.an8.x86_64 22/22 + +Upgraded: + audit-3.0.7-2.an8.2.x86_64 audit-libs-3.0.7-2.an8.2.x86_64 libsemanage-2.9-8.an8.x86_64 policycoreutils-2.9-19.an8.x86_64 +Installed: + checkpolicy-2.9-1.el8.x86_64 libaio-0.3.112-1.el8.x86_64 + mariadb-connector-c-config-3.1.11-2.an8.noarch mecab-0.996-1.module+an8.4.0+10570+ea0623f5.9.x86_64 + mysql-8.0.26-1.0.1.module+an8.4.0+10570+ea0623f5.x86_64 mysql-common-8.0.26-1.0.1.module+an8.4.0+10570+ea0623f5.x86_64 + mysql-errmsg-8.0.26-1.0.1.module+an8.4.0+10570+ea0623f5.x86_64 mysql-server-8.0.26-1.0.1.module+an8.4.0+10570+ea0623f5.x86_64 + policycoreutils-python-utils-2.9-19.an8.noarch protobuf-lite-3.5.0-13.an8.x86_64 + python3-audit-3.0.7-2.an8.2.x86_64 python3-libsemanage-2.9-8.an8.x86_64 + python3-policycoreutils-2.9-19.an8.noarch python3-setools-4.3.0-3.an8.x86_64 + +Complete! +[root@iZbp1h9iqx6mxctz3vuj04Z ~]# service mysqld start +Redirecting to /bin/systemctl start mysqld.service +[root@iZbp1h9iqx6mxctz3vuj04Z ~]# mysql_secure_installation -D + +Securing the MySQL server deployment. + +Connecting to MySQL using a blank password. + +VALIDATE PASSWORD COMPONENT can be used to test passwords +and improve security. It checks the strength of password +and allows the users to set only those passwords which are +secure enough. Would you like to setup VALIDATE PASSWORD component? + +Press y|Y for Yes, any other key for No: y + +There are three levels of password validation policy: + +LOW Length >= 8 +MEDIUM Length >= 8, numeric, mixed case, and special characters +STRONG Length >= 8, numeric, mixed case, special characters and dictionary file + +Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 2 +Please set the password for root here. + +New password: + +Re-enter new password: + +Estimated strength of the password: 100 +Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y +By default, a MySQL installation has an anonymous user, +allowing anyone to log into MySQL without having to have +a user account created for them. This is intended only for +testing, and to make the installation go a bit smoother. +You should remove them before moving into a production +environment. + +Remove anonymous users? (Press y|Y for Yes, any other key for No) : y +Success. + + +Normally, root should only be allowed to connect from +'localhost'. This ensures that someone cannot guess at +the root password from the network. + +Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y +Success. + +By default, MySQL comes with a database named 'test' that +anyone can access. This is also intended only for testing, +and should be removed before moving into a production +environment. + + +Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y + - Dropping test database... +Success. + + - Removing privileges on test database... +Success. + +Reloading the privilege tables will ensure that all changes +made so far will take effect immediately. + +Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y +Success. + +All done! +[root@iZbp1h9iqx6mxctz3vuj04Z ~]# mysql -uroot -pAnolis521! +mysql: [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 10 +Server version: 8.0.26 Source distribution + +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> show databases; ++--------------------+ +| Database | ++--------------------+ +| information_schema | +| mysql | +| performance_schema | +| sys | ++--------------------+ +4 rows in set (0.00 sec) + +mysql> create database test; +Query OK, 1 row affected (0.01 sec) + +mysql> use test; +Database changed +mysql> create table hola(bonj text); +Query OK, 0 rows affected (0.05 sec) + +mysql> insert into test.hola(bonj) values("测试"); +Query OK, 1 row affected (0.01 sec) + +mysql> select * from test.hola; ++--------+ +| bonj | ++--------+ +| 测试 | ++--------+ +1 row in set (0.00 sec) + +mysql> insert into test.hola(bonj) values("Lundo"); +Query OK, 1 row affected (0.00 sec) + +mysql> select * from test.hola; ++--------+ +| bonj | ++--------+ +| 测试 | +| Lundo | ++--------+ +2 rows in set (0.00 sec) + +mysql> delete from test.hola where bonj='Lundo'; +Query OK, 1 row affected (0.01 sec) + +mysql> select * from test.hola; ++--------+ +| bonj | ++--------+ +| 测试 | ++--------+ +1 row in set (0.00 sec) + +mysql> exit +Bye +[root@iZbp1h9iqx6mxctz3vuj04Z ~]# service mysqld stop +Redirecting to /bin/systemctl stop mysqld.service +[root@iZbp1h9iqx6mxctz3vuj04Z ~]# systemctl status mysqld +● mysqld.service - MySQL 8.0 database server + Loaded: loaded (/usr/lib/systemd/system/mysqld.service; disabled; vendor preset: disabled) + Active: inactive (dead) + +Jun 24 15:11:32 iZbp12vl9djt3sklt75mccZ systemd[1]: Starting MySQL 8.0 database server... +Jun 24 15:11:32 iZbp12vl9djt3sklt75mccZ mysql-prepare-db-dir[2727]: Initializing MySQL database +Jun 24 15:11:41 iZbp12vl9djt3sklt75mccZ systemd[1]: Started MySQL 8.0 database server. +Jun 24 15:15:44 iZbp12vl9djt3sklt75mccZ systemd[1]: Stopping MySQL 8.0 database server... +Jun 24 15:15:45 iZbp12vl9djt3sklt75mccZ systemd[1]: mysqld.service: Succeeded. +Jun 24 15:15:45 iZbp12vl9djt3sklt75mccZ systemd[1]: Stopped MySQL 8.0 database server. \ No newline at end of file -- Gitee