2024-03-04T08:59:22.920568Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.36) initializing of server in progress as process 22031
2024-03-04T08:59:22.949805Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-03-04T08:59:23.861796Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2024-03-04T08:59:26.000382Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: k*;2bsNU)&Oo
2024-03-04T08:59:31.115096Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.36) starting as process 22106
2024-03-04T08:59:31.131318Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-03-04T08:59:31.335613Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2024-03-04T08:59:31.639123Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2024-03-04T08:59:31.639170Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2024-03-04T08:59:31.672087Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.36' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server - GPL.
2024-03-04T08:59:31.672090Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
复制代码
截图如下:
7.测试数据库链接,下令如下:
[root@VM-16-11-centos ~]# 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.36
Copyright (c) 2000, 2024, 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 USER() IDENTIFIED BY 'Root@123';
复制代码
截图如下:
如果有修改配置文件的需求,使用以下下令修改配置文件,修改后重启生效:
[root@VM-16-11-centos ~]# vim /etc/my.cnf
复制代码
截图如下:
问题集锦
修改密码时报错:ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
解决方案:
意思是密码强度不敷,试试大小写数字加符号。
或者执行以下下令后重试:
#查看密码配置
show variables like 'validate_password%';
#设置密码强度
SET GLOBAL validate_password.policy=LOW;
SET GLOBAL validate_password.length=0;
SET GLOBAL validate_password.mixed_case_count=0;
SET GLOBAL validate_password.number_count=0;
SET GLOBAL validate_password.special_char_count=0;
FLUSH PRIVILEGES;
ALTER USER USER() IDENTIFIED BY 'iceter';
复制代码
修改乐成,注意:不要修改成关键字,比如:root,依然会报错。
安装时间报错:error: unpacking of archive failed: cpio: Bad magic
解决方案:
查看mysql版本与Linux体系版本是否一致。重新下载版本一致的举行安装即可。