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

相关文章

mysqld_multi在Linux服务器上运行多个MySQL实例

《mysqld_multi在Linux服务器上运行多个MySQL实例》在Linux系统上使用mysqld_multi来启动和管理多个MySQL实例是一种常见的做法,这种方式允许你在同一台机器上运行多个... 目录1. 安装mysql2. 配置文件示例配置文件3. 创建数据目录4. 启动和管理实例启动所有实例

解决IDEA使用springBoot创建项目,lombok标注实体类后编译无报错,但是运行时报错问题

《解决IDEA使用springBoot创建项目,lombok标注实体类后编译无报错,但是运行时报错问题》文章详细描述了在使用lombok的@Data注解标注实体类时遇到编译无误但运行时报错的问题,分析... 目录问题分析问题解决方案步骤一步骤二步骤三总结问题使用lombok注解@Data标注实体类,编译时

将sqlserver数据迁移到mysql的详细步骤记录

《将sqlserver数据迁移到mysql的详细步骤记录》:本文主要介绍将SQLServer数据迁移到MySQL的步骤,包括导出数据、转换数据格式和导入数据,通过示例和工具说明,帮助大家顺利完成... 目录前言一、导出SQL Server 数据二、转换数据格式为mysql兼容格式三、导入数据到MySQL数据

MySQL分表自动化创建的实现方案

《MySQL分表自动化创建的实现方案》在数据库应用场景中,随着数据量的不断增长,单表存储数据可能会面临性能瓶颈,例如查询、插入、更新等操作的效率会逐渐降低,分表是一种有效的优化策略,它将数据分散存储在... 目录一、项目目的二、实现过程(一)mysql 事件调度器结合存储过程方式1. 开启事件调度器2. 创

SQL Server使用SELECT INTO实现表备份的代码示例

《SQLServer使用SELECTINTO实现表备份的代码示例》在数据库管理过程中,有时我们需要对表进行备份,以防数据丢失或修改错误,在SQLServer中,可以使用SELECTINT... 在数据库管理过程中,有时我们需要对表进行备份,以防数据丢失或修改错误。在 SQL Server 中,可以使用 SE

大数据小内存排序问题如何巧妙解决

《大数据小内存排序问题如何巧妙解决》文章介绍了大数据小内存排序的三种方法:数据库排序、分治法和位图法,数据库排序简单但速度慢,对设备要求高;分治法高效但实现复杂;位图法可读性差,但存储空间受限... 目录三种方法:方法概要数据库排序(http://www.chinasem.cn对数据库设备要求较高)分治法(常

golang1.23版本之前 Timer Reset方法无法正确使用

《golang1.23版本之前TimerReset方法无法正确使用》在Go1.23之前,使用`time.Reset`函数时需要先调用`Stop`并明确从timer的channel中抽取出东西,以避... 目录golang1.23 之前 Reset ​到底有什么问题golang1.23 之前到底应该如何正确的

mysql外键创建不成功/失效如何处理

《mysql外键创建不成功/失效如何处理》文章介绍了在MySQL5.5.40版本中,创建带有外键约束的`stu`和`grade`表时遇到的问题,发现`grade`表的`id`字段没有随着`studen... 当前mysql版本:SELECT VERSION();结果为:5.5.40。在复习mysql外键约

Vue项目中Element UI组件未注册的问题原因及解决方法

《Vue项目中ElementUI组件未注册的问题原因及解决方法》在Vue项目中使用ElementUI组件库时,开发者可能会遇到一些常见问题,例如组件未正确注册导致的警告或错误,本文将详细探讨这些问题... 目录引言一、问题背景1.1 错误信息分析1.2 问题原因二、解决方法2.1 全局引入 Element

SQL注入漏洞扫描之sqlmap详解

《SQL注入漏洞扫描之sqlmap详解》SQLMap是一款自动执行SQL注入的审计工具,支持多种SQL注入技术,包括布尔型盲注、时间型盲注、报错型注入、联合查询注入和堆叠查询注入... 目录what支持类型how---less-1为例1.检测网站是否存在sql注入漏洞的注入点2.列举可用数据库3.列举数据库