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

相关文章

数据库面试必备之MySQL中的乐观锁与悲观锁

《数据库面试必备之MySQL中的乐观锁与悲观锁》:本文主要介绍数据库面试必备之MySQL中乐观锁与悲观锁的相关资料,乐观锁适用于读多写少的场景,通过版本号检查避免冲突,而悲观锁适用于写多读少且对数... 目录一、引言二、乐观锁(一)原理(二)应用场景(三)示例代码三、悲观锁(一)原理(二)应用场景(三)示例

如何在Mac上安装并配置JDK环境变量详细步骤

《如何在Mac上安装并配置JDK环境变量详细步骤》:本文主要介绍如何在Mac上安装并配置JDK环境变量详细步骤,包括下载JDK、安装JDK、配置环境变量、验证JDK配置以及可选地设置PowerSh... 目录步骤 1:下载JDK步骤 2:安装JDK步骤 3:配置环境变量1. 编辑~/.zshrc(对于zsh

如何解决idea的Module:‘:app‘platform‘android-32‘not found.问题

《如何解决idea的Module:‘:app‘platform‘android-32‘notfound.问题》:本文主要介绍如何解决idea的Module:‘:app‘platform‘andr... 目录idea的Module:‘:app‘pwww.chinasem.cnlatform‘android-32

售价599元起! 华为路由器X1/Pro发布 配置与区别一览

《售价599元起!华为路由器X1/Pro发布配置与区别一览》华为路由器X1/Pro发布,有朋友留言问华为路由X1和X1Pro怎么选择,关于这个问题,本期图文将对这二款路由器做了期参数对比,大家看... 华为路由 X1 系列已经正式发布并开启预售,将在 4 月 25 日 10:08 正式开售,两款产品分别为华

Node.js 数据库 CRUD 项目示例详解(完美解决方案)

《Node.js数据库CRUD项目示例详解(完美解决方案)》:本文主要介绍Node.js数据库CRUD项目示例详解(完美解决方案),本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考... 目录项目结构1. 初始化项目2. 配置数据库连接 (config/db.js)3. 创建模型 (models/

SQL表间关联查询实例详解

《SQL表间关联查询实例详解》本文主要讲解SQL语句中常用的表间关联查询方式,包括:左连接(leftjoin)、右连接(rightjoin)、全连接(fulljoin)、内连接(innerjoin)、... 目录简介样例准备左外连接右外连接全外连接内连接交叉连接自然连接简介本文主要讲解SQL语句中常用的表

kali linux 无法登录root的问题及解决方法

《kalilinux无法登录root的问题及解决方法》:本文主要介绍kalilinux无法登录root的问题及解决方法,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,... 目录kali linux 无法登录root1、问题描述1.1、本地登录root1.2、ssh远程登录root2、

SQL server配置管理器找不到如何打开它

《SQLserver配置管理器找不到如何打开它》最近遇到了SQLserver配置管理器打不开的问题,尝试在开始菜单栏搜SQLServerManager无果,于是将自己找到的方法总结分享给大家,对SQ... 目录方法一:桌面图标进入方法二:运行窗口进入方法三:查找文件路径方法四:检查 SQL Server 安

MySQL 中的 LIMIT 语句及基本用法

《MySQL中的LIMIT语句及基本用法》LIMIT语句用于限制查询返回的行数,常用于分页查询或取部分数据,提高查询效率,:本文主要介绍MySQL中的LIMIT语句,需要的朋友可以参考下... 目录mysql 中的 LIMIT 语句1. LIMIT 语法2. LIMIT 基本用法(1) 获取前 N 行数据(

SpringBoot应用中出现的Full GC问题的场景与解决

《SpringBoot应用中出现的FullGC问题的场景与解决》这篇文章主要为大家详细介绍了SpringBoot应用中出现的FullGC问题的场景与解决方法,文中的示例代码讲解详细,感兴趣的小伙伴可... 目录Full GC的原理与触发条件原理触发条件对Spring Boot应用的影响示例代码优化建议结论F