mirror of
https://github.com/frappe/frappe.git
synced 2026-04-24 01:14:06 -06:00
Page:
Setup MariaDB Server
Pages
(Client Side Scripting)Fetch values from another document
(Client Side Scripting)Fetching child tables
App Development using GitHub
Client Side Scripting Index
Client side scripting(Archive)
Client side scripting
Deprecations
Developer Cheatsheet
Frappe Framework Front End Routing and Document Creation
Frappe Push Notification Client Reference
Frappe Test Record Loading: Startup Sequence
Generating Test Records in Frappe
Home
Installing Frappe ERPNext on MacOS
Migrating to Version 13
Migrating to Version 14
Migrating to nightly version
Migrating to version 15
Migrating to version 16
Pull Request Review Guidelines
Setup MariaDB Server
Setup NFS Server
The Hitchhiker's Guide to Installing Frappe on Linux
The Hitchhiker's Guide to Installing Frappe on Mac OS X
Tree view for custom DocType
Using Desk Modules, Calendar and List View in Frappe Framework
Using Frappe with Amazon RDS (or any other DBaaS)
Using the VSCode Debugger with Frappe
Writing an IntegrationTestCase in Frappe: A Step‐by‐Step Guide
query builder migration
No results
4
Setup MariaDB Server
Revant Nandgaonkar edited this page 2025-01-21 12:26:41 +05:30
Table of Contents
This setup will create a separate hosted MariaDB server to be used by frappe benches.
Prerequisites
- VM or Server with Ubuntu LTS
- Block volume mounted at
/var/lib/mysql(Optional)
Install MariaDB
Mount volumes (Optional)
In the following example /dev/sda is attached as the block volume.
sudo mkfs.ext4 /dev/sda
sudo mkdir -p /var/lib/mysql
echo '/dev/sda /var/lib/mysql ext4 defaults 0 0' >> /etc/fstab
sudo mount -o defaults /dev/sda /var/lib/mysql
sudo rm -fr /var/lib/mysql/lost+found
Update Ubuntu
sudo apt update && sudo apt dist-upgrade -y
sudo dpkg-reconfigure --priority=low unattended-upgrades
Install MariaDB Server
sudo apt install mariadb-server
sudo mysql_secure_installation
sudo systemctl restart mariadb
Configure MariaDB
- Open the
/etc/mysql/mariadb.conf.d/50-server.cnffile and setbind-address = 0.0.0.0. This step is necessary for server to allow external access. We must protect the server using firewall rules instead. - Add file named
/etc/mysql/mariadb.conf.d/50-server.cnfwith additional configuration required create frappe sites.
Allow external access to MariaDB
Enter mysql shell
sudo mysql -uroot
Replace the PASSWORD with a secure password and enter the following statements:
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%' IDENTIFIED BY 'PASSWORD';
CREATE DATABASE admin;
FLUSH PRIVILEGES;
Make sure Grant_priv property of mysql.user admin@% is set to Y.
SELECT `User`, `Grant_priv` FROM `mysql`.`user` WHERE `User` = 'admin';
UPDATE `mysql`.`user` SET `Grant_priv` = 'Y' WHERE `User` = 'admin';
SELECT `User`, `Grant_priv` FROM `mysql`.`user`;
FLUSH PRIVILEGES;
For 10.11+ use
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
Setup Firewall Rules
- Setup rule to allow only access from VPC to port 3306 of the server
- Optionally use
ufwif cloud or router level firewall is not used.