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

feat: don't require editing MariaDB configuration to setup frappe (backport #25609) #25757

Merged

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Apr 1, 2024

In order to gain flexibility to write Dokos install script and packages, the --no-setup-db parameter of the bench new-site command is a very great improvement!

However, in order to free installation from the need of adding to /etc/mysql/my.cnf

[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

[mysql]
default-character-set = utf8mb4

the function create_database should pass these requirements : CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
and thus we don't need to check GLOBAL mysql VARIABLES.

With this PR, the following :

sudo mysql -u root -e "CREATE USER '$db_name'@'localhost' IDENTIFIED BY '$db_pwd';"
sudo mysql -u root -e "CREATE DATABASE IF NOT EXISTS $db_name CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
sudo mysql -u root -e "GRANT ALL PRIVILEGES ON $db_name . * TO '$db_name'@'localhost';"
sudo mysql -u root -e "FLUSH PRIVILEGES;"

bench new-site $site_name --db-name $db_name --db-password $db_pwd --no-setup-db --admin-password $admin_pwd

could work without changing /etc/mysql/my.cnf .
Actually, we could remove from documentation the requirement to change /etc/mysql/my.cnf


This is an automatic backport of pull request #25609 done by Mergify.

…5609)

* feat(db_requirements): Update db_manager.py

* feat(db-requirements): Update setup_db.py

* feat(db-requirements): Update setup_db.py

Don't add error message on top of check_compatible_versions() 's one

Co-authored-by: gavin <gavin18d@gmail.com>

---------

Co-authored-by: gavin <gavin18d@gmail.com>
(cherry picked from commit ed01fc3)

# Conflicts:
#	frappe/database/mariadb/setup_db.py
@mergify mergify bot requested a review from a team as a code owner April 1, 2024 11:29
@mergify mergify bot added the conflicts label Apr 1, 2024
@mergify mergify bot requested review from akhilnarang and removed request for a team April 1, 2024 11:29
Copy link
Contributor Author

mergify bot commented Apr 1, 2024

Cherry-pick of ed01fc3 has failed:

On branch mergify/bp/version-15-hotfix/pr-25609
Your branch is up to date with 'origin/version-15-hotfix'.

You are currently cherry-picking commit ed01fc3b26.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   frappe/database/db_manager.py

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   frappe/database/mariadb/setup_db.py

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@github-actions github-actions bot added the add-test-cases Add test case to validate fix or enhancement label Apr 1, 2024
@Thatoo
Copy link
Contributor

Thatoo commented Apr 2, 2024

Now that PR #25759 has been merged, this one could be merged too. 😄

@akhilnarang akhilnarang merged commit b47c658 into version-15-hotfix Apr 3, 2024
18 checks passed
@akhilnarang akhilnarang deleted the mergify/bp/version-15-hotfix/pr-25609 branch April 3, 2024 05:25
frappe-pr-bot pushed a commit that referenced this pull request Apr 9, 2024
# [15.21.0](v15.20.0...v15.21.0) (2024-04-09)

### Bug Fixes

* add in_install flag to print_format validate (backport [#25752](#25752)) ([#25779](#25779)) ([b4eb918](b4eb918))
* auto add modified index when sort_field is set to it ([#25686](#25686)) ([#25786](#25786)) ([9e37908](9e37908))
* bigint validation (backport [#25733](#25733)) ([#25822](#25822)) ([4af75a1](4af75a1))
* check if user exists in browse command ([2b50e48](2b50e48))
* Column 'creation' in order clause was ambiguous ([97cc96e](97cc96e))
* copy paste from Excel (issue [#24371](#24371)) ([d816753](d816753))
* copy paste from Excel (issue [#24371](#24371)) ([a31c530](a31c530))
* **dashboard_chart:** use dict.get() to avoid a KeyError ([5fd854a](5fd854a))
* Don't assign returned values if row is deleted ([#25806](#25806)) ([#25826](#25826)) ([be3fd94](be3fd94))
* don't show bulk actions for doctype with workflow ([bf9ed2a](bf9ed2a))
* dont allow querying files to website users ([#25094](#25094)) ([#25701](#25701)) ([f95b4d6](f95b4d6))
* ensure we don't try to add int and NoneType ([8dcabaf](8dcabaf))
* Get filter value based on depends_on field ([#25861](#25861)) ([#25862](#25862)) ([dc113c4](dc113c4))
* **grid:** don't crash if row doesn't exist ([755d4a9](755d4a9))
* **grid:** ensure that `doc.name` is truthy before proceeding ([#25800](#25800)) ([#25829](#25829)) ([6234baf](6234baf))
* **layout:** handle `fieldobj` being null ([67eba0f](67eba0f))
* **link:** get_input_value returns `""` ([#25878](#25878)) ([#25883](#25883)) ([f918416](f918416))
* **ListView:** In ListView make visible link title value for Subject column ([#25569](#25569)) ([30737e5](30737e5)), closes [#25567](#25567)
* log report errors to aid debugging ([#25738](#25738)) ([#25846](#25846)) ([ba8fd90](ba8fd90))
* make_request - prevents an error during response parsing if the response body is empty. ([#24613](#24613)) ([057db90](057db90))
* max-width of email attachment filename ([4b879f2](4b879f2))
* only try JSON if content-type says so ([#24936](#24936)) ([c5ddbb6](c5ddbb6))
* **sentry:** correctly skip `frappe.ValidationError` and its children ([e18ff5d](e18ff5d))
* type error in workflow ([#25847](#25847)) ([#25849](#25849)) ([32bbba3](32bbba3))

### Features

* don't require editing MariaDB configuration to setup frappe (backport [#25609](#25609)) ([#25757](#25757)) ([b47c658](b47c658))
* Include `before_print` in doctype event of Server Script (backport [#25858](#25858)) ([244be81](244be81))
* **router:** Go to default workspace when clicking app logo ([#25706](#25706)) ([#25727](#25727)) ([92919d1](92919d1))

### Performance Improvements

* render list (backport [#25524](#25524)) ([#25699](#25699)) ([d103b91](d103b91))
* **Scheduling:** add jitter to job scheduling ([#25857](#25857)) ([180c3b2](180c3b2)), closes [#19007](#19007)
@frappe-pr-bot
Copy link
Collaborator

🎉 This PR is included in version 15.21.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
add-test-cases Add test case to validate fix or enhancement conflicts released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants