简体   繁体   English

MAMP Pro MySQL问题,将数据库引擎更改为InnoDB并迁移数据库

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

I have MAMP Pro on El Capitan running. 我在El Capitan上运行MAMP Pro。 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. 我混合使用数据库,有些使用MyISAM引擎,有些使用InnoDB。 I don't really know how that works. 我真的不知道那是怎么回事。 I guess if some are InnoDB, the Engine is still MyISAM by default. 我猜如果是InnoDB,默认情况下引擎仍然是MyISAM。 The issue is with databases that I have for Atlassians Confluence and JIRA. 问题出在我为Atlassians Confluence和JIRA提供的数据库中。 In Confluence, all is good, but it says: 在Confluence中,一切都很好,但是它说:

You should increase innodb_log_file_size to 256M 您应该将innodb_log_file_size增加到256M

I tried playing around with the my.cnf, but ran into issues. 我尝试过使用my.cnf,但遇到了问题。 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. 当我取消注释InnoDB部分时,服务器崩溃,并且数据库损坏。

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. 只是想知道如何才能打开InnoDB for MAMP(如果建议这样做),并同时更新现有数据库MyISAM和InnoDB。

While I'm at it, I might want to upgrade MAMP to the newer MySQL version, maybe later. 当我在使用它时,可能要在以后将MAMP升级到更新的MySQL版本。

How much RAM do you have? 你有多少RAM?

Keep max_allowed_packet under 2% of RAM. max_allowed_packet保持在RAM的2%以下。

Since you are using both MyISAM and InnoDB, set innodb_buffer_pool_size to about 1/3 of RAM unless; 由于您同时使用MyISAM和InnoDB, innodb_buffer_pool_size除非将innodb_buffer_pool_size设置为大约RAM的1/3,否则; less if you have a tiny system. 如果您的系统很小,则更少。

Do not change innodb_log_file_size without further instructions. 未经进一步说明,请勿更改innodb_log_file_size That is, don't set it in my.cnf if it is not already set. 也就是说,如果尚未设置,请不要在my.cnf中进行设置。

MyISAM and InnoDB can coexist. MyISAM和InnoDB可以共存。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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