Steps to setup Remote Database
-
Setup the remote DB to accept remote connections, In /etc/mysql/my.cnf or /etc/my.cnf comment out
1.1 #bind-address=0.0.0.0
1.2 #skip-networking(on later versions of mariadb this is not present) -
On the remote DB in mysql enter:
Grant Privilegies to root as GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '[ROOT-SQL-PASSWORD]' WITH GRANT OPTION; -
Restart remote MySQL
sudo service mysql restart -
Add remote IP or Address to the local instance
bench set-mariadb-host [REMOTE-MySQL-IP/ADDRESS] -
So changes are applied do:
bench restart -
Test the connection using
bench mysqlif everything is working fine you should be able to connect to the remote DB server. -
Create new site using:
bench new-site site1.remote --install-app erpnext --verbose
IMPORTANT Create the site only after you are able to connect to connect to the MySQL using bench mysql, otherwise the site will not be created. you should see the following:
frappe@ERPNext:~/frappe-bench$ bench new-site site1.remote --install-app erpnext --verbose MySQL root password: Created user a1947c1ffeceb24a Created database a1947c1ffeceb24a Granted privileges to user a1947c1ffeceb24a and database a1947c1ffeceb24a Starting database import... Imported from database /home/frappe/frappe-bench/apps/frappe/frappe/data/Framework.sql Installing frappe... Updating frappe : [========================================] Updating country info : [========================================] Set Administrator password: Re-enter Administrator password: Installing erpnext... Updating erpnext : [========================================] *** Scheduler is disabled ***