centos6.5 安装 mysql 5.7

复制代码
shell> mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
 
shell> service mysqld restart
Stopping mysqld:                                           [  OK  ]
MySQL Daemon failed to start.
Starting mysqld:                                           [FAILED]
 
#日志中报错如下:
[ERROR] Fatal error: mysql.user table is damaged. Please run mysql_upgrade.
[ERROR] Aborting
 
#这种情况本人是在MySQL5.1到5.7版本升级时遇到的,升级到5.7后,数据库启动失败
#解决的办法就是重新初始化数据库
 
shell> rm -fr /var/lib/mysql
shell> mysqld --initialize --user=mysql
shell> service mysqld restart
Stopping mysqld:                                           [  OK  ]
Starting mysqld:                                           [  OK  ]

Mysql启动报错:InnoDB: Operating system error number 13 in a file operation.的解决方法

是系统问题,解决方案如下:

root@localhost mysql_data]# getenforce

Enforcing

root@localhost mysql_data# setenforce 0

root@localhost mysql_data# getenforce

Permissive
/etc/my.cnf 里面有mysql的日志
看系统版本号

cat /etc/redhat-release
centos6.5安装mysql5.7

CentOs6.5安装MySQL5.7 - 2023年-CSDN博客

  1. rpm -qa | grep mysql# 检查是否安装过 MySQL
  2. rpm -qa | grep mariadb # 检查是否存在 mariadb 数据库(内置的 MySQL 数据库),有则强制删除
  3. rpm -e --nodeps mariadb-libs-5.5.68-1.el7.x86_64 # 强制删除
  4. rpm -e --nodeps mariadb-5.5.68-1.el7.x86_64# 强制删除
    下载到当前文件夹

curl -O repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm

相关推荐
唐青枫3 小时前
MySQL EXISTS 详解:存在性判断、NOT EXISTS 与实战示例
sql·mysql
2301_773643624 小时前
华为云存储实验
网络·mysql·华为云
quan26315 小时前
20260529,日常开发-数据库主从问题
java·mysql·主从·延迟
DIY源码阁8 小时前
JavaSwing宿舍管理系统 - MySQL版
java·数据库·mysql·eclipse
cfm_29148 小时前
MySQL8.0 InnoDB Cluster
数据库·mysql
夜微凉411 小时前
三、MySQL
android·数据库·mysql
暴躁小师兄数据学院11 小时前
【AI大数据工程师特训笔记】第11讲:正则表达式与正则函数
数据库·mysql
IT龟苓膏11 小时前
MySQL InnoDB 内存结构与性能调优:Buffer Pool、脏页、刷盘、临时表和 filesort 一篇讲清
数据库·mysql
加号311 小时前
【MySQL】 审计功能深度解析:从原理到落地实践
数据库·mysql
还是鼠鼠11 小时前
AI掘金头条新闻系统 (Toutiao News)-获取用户信息
后端·python·mysql·fastapi·web