The only supported database for FreeHealth EHR is MariaDB.
In the following guide, all references to “MySQL” shoud be considered to mean “MariaDB”.
The easiest way to try FreeHealth with MariaDB is to install MariaDB on your own laptop or PC: FreeHealth EHR and MariaDB will run on the same machine. This installation guide will cover this basic installation.
For real world professional usage with multiple users and workstations, you should run MariaDB on its own GNU/Linux server. Setting up a network for your healthcare facility is beyond the scope of this installation guide. You can contact one of our recommended partners to help you with this task.
sudo apt-get install mariadb-server mariadb-client sudo mysql -u root GRANT ALL PRIVILEGES ON *.* TO 'freehealth'@'127.0.0.1' IDENTIFIED BY 'MyPassword' WITH GRANT OPTION;
You will use MariaDB user 'freehealth' and its password 'MyPassWord' to install the EHR.
Test by entering this in a terminal:
# note: we are NOT using sudo, this must work with a normal (non root) user, without using sudo mysql -u freehealth -h 127.0.0.1 -pMyPassWord
It should allow you to connect to MariaDB server:
Welcome to the MariaDB monitor. Commands end with ; or \g. ...
If you encounter problems, try to delete mariadb-server or mysql-server completely (use a search engine to learn how to do it, removing the package is not enough even with purge option), reboot and try again. If you still can't get user 'freehealth' to connect to MariaDB server with a password (without sudo or a root user), you should consider getting professional help to install the database.
MariaDB server setup is done.
Most connection errors are not related to a bug in the EHR. An error message is displayed in a textbox to help you fix the problem. If you are using version 0.11 or higher, detailed information is available in a log file created inside your home or user folder for each connection error. The filename start with EHR_log_ followed by a date and time stamp. The file type is .txt A typical log file will be named
EHR_log_2017_11_19_22_04_01.txt
Please check if you can connect to your database with the mysql client before asking for help on the forum. The user should be freehealth or equivalent to root and be able to read the mysql database:
SELECT User FROM mysql.user;
systemctl status mariadb.service ● mariadb.service - MariaDB database server Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled) Drop-In: /etc/systemd/system/mariadb.service.d └─migrated-from-my.cnf-settings.conf Active: active (running) since Sat 2017-08-05 21:23:16 CEST; 2min 52s ago
If you see “active (running)”, it is up and running.
In /etc/mysql/my.cnf
If you set 'bind-address' to '::' MariaDB will accept IPv4 and IPv6 connections from the network (both Local Area Network and Wide Area Network aka Internet).
[mysqld] bind-address = ::
If my.cnf is set correctly and you still cannot connect, it could be the firewall. Some VPS providers and/or some GNU/Linux distributions install a firewall by default.
UFW aka Uncomplicated Firewall comes by default with Ubuntu. Allow tcp traffic on port 3306:
ufw allow 3306/tcp service ufw restart systemctl restart mariadb.service
Debian comes with IPTables configured to allow all traffic, but someone or something could have changed the rules since installation.
Check your iptables rules:
iptables --list iptables -A INPUT -i eth0 -p tcp --destination-port 3306 -j ACCEPT systemctl restart mariadb.service
Remnants of previous MySQL installation are known to cause problems.
If you encounter problems, try to delete any previous installation of mysql-server completely (use a search engine to learn how to do it, removing the package is not enough even with purge option, you need to delete a collection of system files), reboot and try again.