Skip to content

Conversation

@brennentsmith
Copy link
Contributor

During site deletion, the hostname for the site's MySQL user was pulled from the site specific wp-config.php file rather than easyengine.conf.

This caused a critical error to occur when using a external mysql GRANT host established in easyengine.conf, as the MySQL database host was stored in wp-config.php which would not be the same as the granted host/IP (as the granted IP would traditionally be the webserver). This critical error would leave the system in an incongruent state, as the database would have been dropped, but the MySQL user+ Nginx configuration + web root would not be touched.

This simply checks if ee_lib_variables.sh changed the constant $EE_MYSQL_GRANT_HOST, and if it has been changed, modifies the ee_db_host variable to match.

@brennentsmith brennentsmith changed the title Fixed site deletion when using external MySQL host Critical error during site deletion when using external MySQL host Oct 14, 2014
@gau1991
Copy link
Contributor

gau1991 commented Oct 15, 2014

@brennentsmith ,
Thanks for pull request. We tested it, Its working fine.
Although our thought is instead of adding following lines

if [ "$EE_MYSQL_GRANT_HOST" != "localhost" ]; then
 # If MySQL grant host is set, use that value instead
 ee_db_host=$EE_MYSQL_GRANT_HOST
fi

If we only change line 33
to

mysql -e "drop user '$ee_db_user'@'$EE_MYSQL_GRANT_HOST'"

it will work fine. What you think?

@brennentsmith
Copy link
Contributor Author

If that would be safe at all times, then I agree that would be a good course of action - I was just worried about any dependencies upon ee_db_host and wanted to take the most conservative code alteration. New commit altered as suggested.

gau1991 pushed a commit that referenced this pull request Oct 16, 2014
Critical error during site deletion when using external MySQL host
@gau1991 gau1991 merged commit 59e581b into EasyEngine:master Oct 16, 2014
gau1991 pushed a commit that referenced this pull request Dec 18, 2014
Critical error during site deletion when using external MySQL host
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants