Mac下MAMP Pro 启动数据库MySQL出错导致无法启动的问题

2024-02-29 02:18

本文主要是介绍Mac下MAMP Pro 启动数据库MySQL出错导致无法启动的问题,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

问题1:

InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 35
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 35
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 35
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
130305 19:49:08  InnoDB: Unable to open the first data file
InnoDB: Error in opening ./ibdata1
130305 19:49:08  InnoDB: Operating system error number 35 in a file operation.

此问题的关键在于:

Check that you do not already have another mysqld process

表示有多个mysql进程正在执行,解决方法如下:

1、打开终端,输入$ ps aux | grep mysqld 检查mysql进程打开终端,输入$ ps aux | grep mysqld 检查mysql进程


2.找到相应的进程号,停掉相应的进程,最后保留一条mysql的进程即可

比如:$ kill 1234(此处1234 为你的进程号)



然后就可以正常使用你的mysql 了。





问题2:

2017-07-31 10:37:08 12746 [Note] Plugin 'FEDERATED' is disabled.
2017-07-31 10:37:08 12746 [Note] InnoDB: Using atomics to ref count buffer pool pages
2017-07-31 10:37:08 12746 [Note] InnoDB: The InnoDB memory heap is disabled
2017-07-31 10:37:08 12746 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-07-31 10:37:08 12746 [Note] InnoDB: Memory barrier is not used
2017-07-31 10:37:08 12746 [Note] InnoDB: Compressed tables use zlib 1.2.8
2017-07-31 10:37:08 12746 [Note] InnoDB: Using CPU crc32 instructions
2017-07-31 10:37:08 12746 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2017-07-31 10:37:08 12746 [Note] InnoDB: Completed initialization of buffer pool
2017-07-31 10:37:08 12746 [Note] InnoDB: Highest supported file format is Barracuda.
2017-07-31 10:37:08 12746 [Note] InnoDB: The log sequence numbers 1638988 and 1638988 in ibdata files do not match the log sequence number 1644885 in the ib_logfiles!
2017-07-31 10:37:08 12746 [Note] InnoDB: Database was not shutdown normally!
2017-07-31 10:37:08 12746 [Note] InnoDB: Starting crash recovery.
2017-07-31 10:37:08 12746 [Note] InnoDB: Reading tablespace information from the .ibd files...
2017-07-31 10:37:08 12746 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace info/test uses space ID: 3 at filepath: ./info/test.ibd. Cannot open tablespace mysql/slave_relay_log_info which uses space ID: 3 at filepath: ./mysql/slave_relay_log_info.ibd
2017-07-31 10:37:08 7ffff2e8f3c0  InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
InnoDB: If you are installing InnoDB, remember that you must create
InnoDB: directories yourself, InnoDB does not create them.
InnoDB: Error: could not open single-table tablespace file ./mysql/slave_relay_log_info.ibd
InnoDB: We do not continue the crash recovery, because the table may become
InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it.
InnoDB: To fix the problem and start mysqld:
InnoDB: 1) If there is a permission problem in the file and mysqld cannot
InnoDB: open the file, you should modify the permissions.
InnoDB: 2) If the table is not needed, or you can restore it from a backup,
InnoDB: then you can remove the .ibd file, and InnoDB will do a normal
InnoDB: crash recovery and ignore that table.
InnoDB: 3) If the file system or the disk is broken, and you cannot remove
InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf
InnoDB: and force InnoDB to continue crash recovery here.

此问题的关键在于:

InnoDB: Attempted to open a previously opened tablespace. Previous tablespace db_patients/tb_patients uses space ID: 3 at filepath: ./db_patients/tb_patients.ibd. Cannot open tablespace mysql/slave_relay_log_info which uses space ID: 3 at filepath: ./mysql/slave_relay_log_info.ibd

解决办法:


一、打开MAMP PRO,选择菜单栏File->Edit Template->MySQL->5.5.3(选择你的版本)),这时打开了一个文本,找到

[mysqld]
注意带上中括号,在这行下面加一行
innodb_force_recovery = 1 (可换1-6 进行尝试)


二、启动mySQL,成功后再关闭;



三、重新打开那个文本,删除添加的 innodb_force_recovery = 1 行;



四、再打开mySQL,完毕。



这篇关于Mac下MAMP Pro 启动数据库MySQL出错导致无法启动的问题的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/757297

相关文章

Java通过驱动包(jar包)连接MySQL数据库的步骤总结及验证方式

《Java通过驱动包(jar包)连接MySQL数据库的步骤总结及验证方式》本文详细介绍如何使用Java通过JDBC连接MySQL数据库,包括下载驱动、配置Eclipse环境、检测数据库连接等关键步骤,... 目录一、下载驱动包二、放jar包三、检测数据库连接JavaJava 如何使用 JDBC 连接 mys

SQL中如何添加数据(常见方法及示例)

《SQL中如何添加数据(常见方法及示例)》SQL全称为StructuredQueryLanguage,是一种用于管理关系数据库的标准编程语言,下面给大家介绍SQL中如何添加数据,感兴趣的朋友一起看看吧... 目录在mysql中,有多种方法可以添加数据。以下是一些常见的方法及其示例。1. 使用INSERT I

Qt使用QSqlDatabase连接MySQL实现增删改查功能

《Qt使用QSqlDatabase连接MySQL实现增删改查功能》这篇文章主要为大家详细介绍了Qt如何使用QSqlDatabase连接MySQL实现增删改查功能,文中的示例代码讲解详细,感兴趣的小伙伴... 目录一、创建数据表二、连接mysql数据库三、封装成一个完整的轻量级 ORM 风格类3.1 表结构

MySQL 中的 CAST 函数详解及常见用法

《MySQL中的CAST函数详解及常见用法》CAST函数是MySQL中用于数据类型转换的重要函数,它允许你将一个值从一种数据类型转换为另一种数据类型,本文给大家介绍MySQL中的CAST... 目录mysql 中的 CAST 函数详解一、基本语法二、支持的数据类型三、常见用法示例1. 字符串转数字2. 数字

Mysql实现范围分区表(新增、删除、重组、查看)

《Mysql实现范围分区表(新增、删除、重组、查看)》MySQL分区表的四种类型(范围、哈希、列表、键值),主要介绍了范围分区的创建、查询、添加、删除及重组织操作,具有一定的参考价值,感兴趣的可以了解... 目录一、mysql分区表分类二、范围分区(Range Partitioning1、新建分区表:2、分

MySQL 定时新增分区的实现示例

《MySQL定时新增分区的实现示例》本文主要介绍了通过存储过程和定时任务实现MySQL分区的自动创建,解决大数据量下手动维护的繁琐问题,具有一定的参考价值,感兴趣的可以了解一下... mysql创建好分区之后,有时候会需要自动创建分区。比如,一些表数据量非常大,有些数据是热点数据,按照日期分区MululbU

SQL Server配置管理器无法打开的四种解决方法

《SQLServer配置管理器无法打开的四种解决方法》本文总结了SQLServer配置管理器无法打开的四种解决方法,文中通过图文示例介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的... 目录方法一:桌面图标进入方法二:运行窗口进入检查版本号对照表php方法三:查找文件路径方法四:检查 S

MySQL 删除数据详解(最新整理)

《MySQL删除数据详解(最新整理)》:本文主要介绍MySQL删除数据的相关知识,本文通过实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友参考下吧... 目录一、前言二、mysql 中的三种删除方式1.DELETE语句✅ 基本语法: 示例:2.TRUNCATE语句✅ 基本语

MySQL中查找重复值的实现

《MySQL中查找重复值的实现》查找重复值是一项常见需求,比如在数据清理、数据分析、数据质量检查等场景下,我们常常需要找出表中某列或多列的重复值,具有一定的参考价值,感兴趣的可以了解一下... 目录技术背景实现步骤方法一:使用GROUP BY和HAVING子句方法二:仅返回重复值方法三:返回完整记录方法四:

从入门到精通MySQL联合查询

《从入门到精通MySQL联合查询》:本文主要介绍从入门到精通MySQL联合查询,本文通过实例代码给大家介绍的非常详细,需要的朋友可以参考下... 目录摘要1. 多表联合查询时mysql内部原理2. 内连接3. 外连接4. 自连接5. 子查询6. 合并查询7. 插入查询结果摘要前面我们学习了数据库设计时要满