Problem with rendering address field on profile page
解决方案
The issue is caused by inability to load address attributes from EAV tables in the database. Magento assumes values of certain IDs invariant and thus they're hard-coded in a PHP code for performance optimization purposes. Attribute set ID = 2 is hard-coded for address attributes. However, the field eav_attribute_set.attribute_set_id
is AUTO_INCREMENT
and thus is governed by MySQL settings auto_increment_increment and auto_increment_offset. Having non-default values for those settings is the root cause of the issue.
The fix:
- Make changes to the MySQL config
my.cnf
:auto_increment_increment = 1
auto_increment_offset = 1
- Restart MySQL to apply the config changes
- Create a new empty database
- Re-install Magento from scratch to the new database
Note: Changing MySQL settings above will not recover the existing database.