获取软件包:

首先要有oracle网站的帐号。

mysql官网---下载,网站下面,如下:

image

 

image

 注意:archives是下载历史版本

通过yum repo 下载,通常是最新版。如果要选择下载特定版本,选download archives。

image

下载相应的bundle版本即可。

 此处以REDHAT/bundle为例。下载并上传,再解tar包。

安装时,用--nodeps选项。

rpm -ivh ./mysql-community-*.rpm --nodeps

启动进程:(出错)

[root@kylin etc]# systemctl start mysqld.service
Job for mysqld.service failed because the control process exited with error code.
See "systemctl status mysqld.service" and "journalctl -xe" for details.
[root@kylin etc]# systemctl status mysqld.service
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2025-11-03 14:03:42 CST; 11s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 200499 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Process: 200533 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS (code=exited, status=127)
Main PID: 200533 (code=exited, status=127)

11月 03 14:03:42 kylin systemd[1]: mysqld.service: Main process exited, code=exited, status=127/n/a
11月 03 14:03:42 kylin systemd[1]: mysqld.service: Failed with result 'exit-code'.
11月 03 14:03:42 kylin mysqld[200533]: /usr/sbin/mysqld: error while loading shared libraries: libssl.so.3: cannot open>
11月 03 14:03:42 kylin systemd[1]: Failed to start MySQL Server.
11月 03 14:03:42 kylin systemd[1]: mysqld.service: Service RestartSec=100ms expired, scheduling restart.
11月 03 14:03:42 kylin systemd[1]: mysqld.service: Scheduled restart job, restart counter is at 5.
11月 03 14:03:42 kylin systemd[1]: Stopped MySQL Server.
11月 03 14:03:42 kylin systemd[1]: mysqld.service: Start request repeated too quickly.
11月 03 14:03:42 kylin systemd[1]: mysqld.service: Failed with result 'exit-code'.
11月 03 14:03:42 kylin systemd[1]: Failed to start MySQL Server.

ldd /usr/sbin/mysqld,发现包括openssl等一些库文件不存在。说明与kylinV10不匹配。重新下载5.7.44,就可以了

启动:systemctl start mysqld.service 

查看:/var/log/mysqld.log,查找password, 找到一个临时密码:=pqW:4pn26dC

mysql -p进行登录,正常应该可以成功。

然后改密码:mysql_secure_installation

# 登录 MySQL
mysql -u root -p

# 在 MySQL 中执行:
ALTER USER 'root'@'localhost' IDENTIFIED BY '新密码';
FLUSH PRIVILEGES;
EXIT;

 

posted on 2025-11-04 09:16  胡彼德  阅读(7)  评论(0)    收藏  举报