Search code examples
mysqlmacosmamp

MySQL server doesn't run via MAMP on mac OS


I upgraded my MAMP PRO 3.5.2 version to the 5th and MySQL start fails.

I killed mysqld processes via killall -9 mysqld, cleaned log files like ib_logfile* and tried manipulations with innodb recovery.

The log I've got looks like this:

2018-10-10T14:16:12.6NZ mysqld_safe Logging to '/Applications/MAMP/logs/mysql_error.log'. 2018-10-10T14:16:12.6NZ mysqld_safe Starting mysqld daemon with databases from /Library/Application Support/appsolute/MAMP PRO/db/mysql57 2018-10-10T14:16:13.043096Z 0 [Warning] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path. 2018-10-10T14:16:13.051110Z 0 [Note] /Applications/MAMP/Library/bin/mysqld (mysqld 5.7.23) starting as process 5538 ... 2018-10-10T14:16:13.064223Z 0 [Warning] Setting lower_case_table_names=2 because file system for /Library/Application Support/appsolute/MAMP PRO/db/mysql57/ is case insensitive 2018-10-10T14:16:13.074890Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2018-10-10T14:16:13.074926Z 0 [Note] InnoDB: Uses event mutexes 2018-10-10T14:16:13.074936Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier 2018-10-10T14:16:13.074943Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3 2018-10-10T14:16:13.074972Z 0 [Note] InnoDB: Adjusting innodb_buffer_pool_instances from 8 to 1 since innodb_buffer_pool_size is less than 1024 MiB 2018-10-10T14:16:13.079521Z 0 [Note] InnoDB: Number of pools: 1 2018-10-10T14:16:13.084840Z 0 [Note] InnoDB: Using CPU crc32 instructions 2018-10-10T14:16:13.089357Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M 2018-10-10T14:16:13.114376Z 0 [Note] InnoDB: Completed initialization of buffer pool 2018-10-10T14:16:13.140491Z 0 [Note] InnoDB: Highest supported file format is Barracuda. 2018-10-10T14:16:13.145746Z 0 [ERROR] InnoDB: Trying to access page number 527111 in space 0, space name innodb_system, which is outside the tablespace bounds. Byte offset 0, len 16384, i/o type read. If you get this error at mysqld startup, please check that your my.cnf matches the ibdata files that you have in the MySQL server. 2018-10-10T14:16:13.145772Z 0 [ERROR] InnoDB: Server exits. 2018-10-10T14:16:13.6NZ mysqld_safe mysqld from pid file /Applications/MAMP/tmp/mysql/mysql.pid ended

Would appreciate any hint which direction to go as I start to consider to uninstall and reinstall of MAMP which means I will lose few local DB installations.

Thanks!


Solution

  • So the issue was solved and MySQL runs locally via MAMP 5.1.

    While figuring out what was going wrong in the my.cnf following settings were applied:

    • increased innodb_buffer_pool_size value: innodb_buffer_pool_size = 1024M
    • force recovery mode was on innodb_force_recovery = 1

    That lead to the error that mentioned in the question:

    [ERROR] InnoDB: Trying to access page number 527111 in space 0, space name innodb_system, which is outside the tablespace bounds. Byte offset 0, len 16384, i/o type read. If you get this error at mysqld startup, please check that your my.cnf matches the ibdata files that you have in the MySQL server.

    At this point default settings for the ibdata dir and path were uncommented inside of my.cnf:

    innodb_data_home_dir = "/Library/Application Support/appsolute/MAMP PRO/db/mysql57"

    innodb_data_file_path = ibdata1:10M:autoextend

    innodb_log_group_home_dir = "/Library/Application Support/appsolute/MAMP PRO/db/mysql57"

    Error log was reported on access limits (don't have an exact sentence at front of me), was lost a bit here, and as a guess measure, I extended rights for the folder /Library/Application Support/appsolute/MAMP PRO/db/mysql57 to my current user.

    That didn't change the log. The error about a wrong path to the ibdata was still there.

    In the end the renaming of the folder mysql (where was the full version of ibdata (~40Gb)) to mysql57 helped.

    There was following folder structure in /Library/Application Support/appsolute/MAMP PRO/db/ after the installation of MAMP 5.1:

    -- mysql

    -- mysql56_TIMESTAMP

    -- mysql57

    with the same structure of files, but a closer comparison of the content showed that the full version of the file inside of mysql, so renamed it, and removed all folders after tests that MAMP works correctly without them.

    So now I have only one mysql folder inside of /Library/Application Support/appsolute/MAMP PRO/db/. The settings inside of my.cnf that I customized in the process rolled back.