【linux】mysql测试环境安装

[root@localhost ~]# cd /home/lightdb/soft/mysql
[root@localhost mysql]# ll
total 823256
drwxr-xr-x. 2 lightdb lightdb      4096 Sep 28 04:54 mysql-8.0.28
--w-------. 1 lightdb lightdb 843008000 Sep 28 04:46 mysql-8.0.28-1.el7.x86_64.rpm-bundle.tar
[root@localhost mysql]# rpm -ivh mysql-community-common-8.0.28-1.el7.x86_64.rpm
error: open of mysql-community-common-8.0.28-1.el7.x86_64.rpm failed: No such file or directory
[root@localhost mysql]# cd mysql-8.0.28/
[root@localhost mysql-8.0.28]# rpm -ivh mysql-community-common-8.0.28-1.el7.x86_64.rpm
warning: mysql-community-common-8.0.28-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
Preparing...                          ################################# [100%]
    package mysql-community-common-8.0.28-1.el7.x86_64 is already installed
[root@localhost mysql-8.0.28]# ll
total 823244
-rwxr-xr-x. 1 lightdb lightdb  55199948 Dec 18  2021 mysql-community-client-8.0.28-1.el7.x86_64.rpm
-rwxr-xr-x. 1 lightdb lightdb   5933684 Dec 18  2021 mysql-community-client-plugins-8.0.28-1.el7.x86_64.rpm
-rwxr-xr-x. 1 lightdb lightdb    645388 Dec 18  2021 mysql-community-common-8.0.28-1.el7.x86_64.rpm
-rwxr-xr-x. 1 lightdb lightdb   7763684 Dec 18  2021 mysql-community-devel-8.0.28-1.el7.x86_64.rpm
-rwxr-xr-x. 1 lightdb lightdb  23637584 Dec 18  2021 mysql-community-embedded-compat-8.0.28-1.el7.x86_64.rpm
-rwxr-xr-x. 1 lightdb lightdb   2215928 Dec 18  2021 mysql-community-icu-data-files-8.0.28-1.el7.x86_64.rpm
-rwxr-xr-x. 1 lightdb lightdb   4935572 Dec 18  2021 mysql-community-libs-8.0.28-1.el7.x86_64.rpm
-rwxr-xr-x. 1 lightdb lightdb   1265072 Dec 18  2021 mysql-community-libs-compat-8.0.28-1.el7.x86_64.rpm
-rwxr-xr-x. 1 lightdb lightdb 473116268 Dec 18  2021 mysql-community-server-8.0.28-1.el7.x86_64.rpm
-rwxr-xr-x. 1 lightdb lightdb 268279684 Dec 18  2021 mysql-community-test-8.0.28-1.el7.x86_64.rpm
[root@localhost mysql-8.0.28]# rpm -ivh mysql-community-client-plugins-8.0.28-1.el7.x86_64.rpm 
warning: mysql-community-client-plugins-8.0.28-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
Preparing...                          ################################# [100%]
    package mysql-community-client-plugins-8.0.28-1.el7.x86_64 is already installed
[root@localhost mysql-8.0.28]# rpm -ivh mysql-community-libs-8.0.28-1.el7.x86_64.rpm 
warning: mysql-community-libs-8.0.28-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
error: Failed dependencies:
    mariadb-libs is obsoleted by mysql-community-libs-8.0.28-1.el7.x86_64
[root@localhost mysql-8.0.28]# rpm -e mariadb-libs --nodeps
[root@localhost mysql-8.0.28]# rpm -ivh mysql-community-libs-8.0.28-1.el7.x86_64.rpm 
warning: mysql-community-libs-8.0.28-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:mysql-community-libs-8.0.28-1.el7################################# [100%]
[root@localhost mysql-8.0.28]# rpm -ivh mysql-community-libs-compat-8.0.28-1.el7.x86_64.rpm 
warning: mysql-community-libs-compat-8.0.28-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:mysql-community-libs-compat-8.0.2################################# [100%]
[root@localhost mysql-8.0.28]# rpm -ivh mysql-community-devel-8.0.28-1.el7.x86_64.rpm 
warning: mysql-community-devel-8.0.28-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:mysql-community-devel-8.0.28-1.el################################# [100%]
[root@localhost mysql-8.0.28]# rpm -ivh mysql-community-client-8.0.28-1.el7.x86_64.rpm 
warning: mysql-community-client-8.0.28-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:mysql-community-client-8.0.28-1.e################################# [100%]
[root@localhost mysql-8.0.28]# rpm -ivh mysql-community-server-8.0.28-1.el7.x86_64.rpm 
warning: mysql-community-server-8.0.28-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
error: Failed dependencies:
    mysql-community-icu-data-files = 8.0.28-1.el7 is needed by mysql-community-server-8.0.28-1.el7.x86_64
[root@localhost mysql-8.0.28]# ls -l mysql-community-icu-data-file*
-rwxr-xr-x. 1 lightdb lightdb 2215928 Dec 18  2021 mysql-community-icu-data-files-8.0.28-1.el7.x86_64.rpm
[root@localhost mysql-8.0.28]# rpm -ivh mysql-community-icu-data-files-8.0.28-1.el7.x86_64.rpm 
warning: mysql-community-icu-data-files-8.0.28-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:mysql-community-icu-data-files-8.################################# [100%]
[root@localhost mysql-8.0.28]# rpm -ivh mysql-community-server-8.0.28-1.el7.x86_64.rpm 
warning: mysql-community-server-8.0.28-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:mysql-community-server-8.0.28-1.e################################# [100%]
[root@localhost mysql-8.0.28]# systemctl start mysqld
[root@localhost mysql-8.0.28]# cat /var/log/mysqld.log
2022-10-10T07:40:56.326600Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.28) initializing of server in progress as process 4535
2022-10-10T07:40:56.342373Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-10-10T07:40:56.585126Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2022-10-10T07:40:57.207545Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: 3oDca&D,tV!_
2022-10-10T07:40:59.706453Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.28) starting as process 4590
2022-10-10T07:40:59.717621Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-10-10T07:40:59.828332Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2022-10-10T07:41:00.042012Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2022-10-10T07:41:00.042065Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2022-10-10T07:41:00.066395Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.28'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MySQL Community Server - GPL.
2022-10-10T07:41:00.066403Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
[root@localhost mysql-8.0.28]# mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.28

Copyright (c) 2000, 2022, 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> 

mysql> ALTER  USER  'root'@'localhost'  IDENTIFIED BY 'lightDB@123';

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.00 sec)

mysql> show global variables like 'port';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| port          | 3306  |
+---------------+-------+
1 row in set (0.01 sec)

mysql> 
 

MySQL :: Download MySQL Installer

你可能感兴趣的:(安装,mysql,数据库,服务器)