Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix db name with hypen issue #346

Merged
merged 7 commits into from
Aug 7, 2020

Conversation

kirtangajjar
Copy link
Contributor

@kirtangajjar kirtangajjar commented Jul 31, 2020

This PR fixes issue where if you specify a dbname with hyphen, you won't be able to create db. See - https://community.easyengine.io/t/cant-create-a-website-with-dbname-option/13926

What this PR does is, it replaces " with ' and wraps db name in backticks `.
i.e.

Before:

mysql -uroot -p"$MYSQL_ROOT_PASSWORD" -e"CREATE USER 'example.local-N4Ujuo'@'%' IDENTIFIED BY 'ZrNCJlx2KfsI'; CREATE DATABASE humo-gen; GRANT ALL PRIVILEGES ON humo-gen.* TO 'example.local-N4Ujto'@'%'; FLUSH PRIVILEGES;"

After:

mysql -uroot -p"$MYSQL_ROOT_PASSWORD" -e'CREATE USER "example.local-N4Ujuo"@"%" IDENTIFIED BY "ZrNCJlx2KfsI"; CREATE DATABASE `humo-gen`; GRANT ALL PRIVILEGES ON `humo-gen`.* TO "example.local-N4Ujto"@"%"; FLUSH PRIVILEGES;"

Also, I noticed in some cases when site creation fails and if /tmp/db_exec is not removed, site creation fails, so I've removed that file on site deletion.

Closes: EasyEngine/easyengine#1459

src/helper/class-ee-site.php Outdated Show resolved Hide resolved
Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com>
Copy link
Member

@mrrobot47 mrrobot47 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mrrobot47 mrrobot47 merged commit 85e542f into EasyEngine:develop Aug 7, 2020
@mrrobot47 mrrobot47 deleted the fix/db-name-hyphen branch August 7, 2020 05:03
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.

Cleanup /tmp/db_exec on site cleanup
2 participants