简体   繁体   中英

MAMP Pro MySQL issue with changing database engine to InnoDB and migrating databases

I have MAMP Pro on El Capitan running. It has been fine up until now, but I've run into a problem. I have a mixture of database, some using the MyISAM Engine and others using InnoDB. I don't really know how that works. I guess if some are InnoDB, the Engine is still MyISAM by default. The issue is with databases that I have for Atlassians Confluence and JIRA. In Confluence, all is good, but it says:

You should increase innodb_log_file_size to 256M

I tried playing around with the my.cnf, but ran into issues. I restored things, and these are the relevant sections from the config.

[mysqld]
#port       = 9999
socket      = /Applications/MAMP/tmp/mysql/mysql.sock
key_buffer_size = 64M
max_allowed_packet = 512M

# table_cache only works for MySQL 5.5.x
#table_cache = 64

# If you are running MySQL 5.6.x, use table_open_cache.
#table_open_cache = 64

sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 32M

#Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /Applications/MAMP/db/mysql/
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = /Applications/MAMP/db/mysql/
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 128M
#innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 512M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50

When I uncommented the InnoDB section the server crashes and the database got corrupted.

Just wondering how I can turn on InnoDB for MAMP, if that is recommended, and update my existing databases at the same time, the MyISAM ones and the InnoDB ones.

While I'm at it, I might want to upgrade MAMP to the newer MySQL version, maybe later.

How much RAM do you have?

Keep max_allowed_packet under 2% of RAM.

Since you are using both MyISAM and InnoDB, set innodb_buffer_pool_size to about 1/3 of RAM unless; less if you have a tiny system.

Do not change innodb_log_file_size without further instructions. That is, don't set it in my.cnf if it is not already set.

MyISAM and InnoDB can coexist.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM