欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 运维知识 > 数据库 >内容正文

数据库

mysql rpm安装报错_Mysql rpm包安装

发布时间:2025/3/15 数据库 30 豆豆
生活随笔 收集整理的这篇文章主要介绍了 mysql rpm安装报错_Mysql rpm包安装 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

1.下载 MySQL-client-5.6.25-1.linux_glibc2.5.x86_64.rpm  MySQL-devel-5.6.25-1.linux_glibc2.5.x86_64.rpm  MySQL-server-5.6.25-1.linux_glibc2.5.x86_64.rpm这三个软件包,注意版本要一致:

2.安装三个RPM包,遇到冲突和依赖可以先删除相应的软件。

rpm -ivh MySQL-server-5.6.25-1.linux_glibc2.5.x86_64.rpm

rpm -ivh MySQL-client-5.6.25-1.linux_glibc2.5.x86_64.rpm

rpm -ivh MySQL-devel-5.6.25-1.linux_glibc2.5.x86_64.rpm

3.启动mysql

/etc/init.d/mysql start

/etc/rc.d/init.d/mysql #启动文件

/usr/share/my #包含my-default.cnf文件

/usr/my.cnf #主配置文件

/usr/lib64/mysql#mysql#库文件夹

/var/lib/mysql#数据库文件存放目录

4.登入mysql报错

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

5.先停用数据库服务

service mysqld stop

查看进程端口是否停用

ss -tnlp|grep mysql

进入MYSQL安全模式,通常会卡住,其实是在后台运行,所以一分钟后按Ctrl+C

/usr/bin/mysqld_safe --skip-grant-table &

然后以无密码登录

mysql -u root

6.修改密码

使用mysql数据库

use mysql

重设root密码

update user set password=PASSWORD("huaxia") where user='root';

刷新库

flush privileges;

退出

quit;

7.重新登入数据库

[root@sever9 ~]# mysql -u root -p

Enter password:

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 4

Server version: 5.6.25-log MySQL Community Server (GPL)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

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 rpm安装报错_Mysql rpm包安装的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。