Step 3 - Creating Database and First User | ERROR. unable to execute SQL // due to: Invalid default value for 'created_date'

Situation
The OpenEMR (Installation) Setup Step 3 stops when trying to create table ‘created_date’ with error: " due to: Invalid default value for ‘created_date’ ".

I have done a full installation by following this tutorial: https://www.open-emr.org/wiki/images/1/16/Configuration_Cookbook_For_OpenEMR_Using_Red_Hat's_Free_CentOS-7_Operating_System_1st_Ed.pdf

I have created the database and the user previously. I tried doing it from the command line and from phpMyAdmin. I am using utf8_general_ci.
The same error results when I select the option “Have setup create the database”

OpenEMR Version
I’m using OpenEMR version [openemr-7.0.0.tar.gz]

Browser:
I’m using: Chrome Versión 108.0.5359.125 (Build oficial) (64 bits)

Operating System
I’m using: CentOS-7
Red Hat Enterprise Linux Server release 7.9

PHP Version 7.4.33
Apache Version 2.4.6
MariaDB Version: 5.5.68

Please, any suggestions?
Thanks in advance.
Federico

@Fede_rico is there a reason that you don’t use the installation tool and let it create the database instead of you manually creating the database? From my experience, it is far better to allow the install process create the database. Than for you to manually create it. There is a higher likely hood of errors such as this if you created the database manually than programmatically.

Aló @juggernautsei , thank you for taking the time for answer me.

I have tried both ways, but the result has been the same. In fact, I tried first with the method that you recommend and since it did not give good results, I tried the manual method.

@Fede_rico did you install all the dependencies

OpenEMR System Architecture - OpenEMR Project Wiki

 sudo apt-get install apache2 mariadb-server libapache2-mod-php libtiff-tools php php-mysql php-cli php-gd php-xml php-curl php-soap php-json imagemagick php-mbstring php-zip php-ldap

ok, installed dependencies, now, i get:

Connecting to MySQL Server… OK.
Creating database… OK.
Creating user with permissions for database… ERROR when creating specified user. unable to execute SQL: ‘CREATE USER ‘openemr’@‘localhost’ IDENTIFIED BY ‘MySuperSecurePass123’’ due to: Operation CREATE USER failed for ‘openemr’@‘localhost’

:laughing:

Do you think it is convenient to start a clean installation with Ubuntu and follow a more updated step by step?

Thanks a lot.

What is happening is the user account that you are using as the root account does not have GRANT OPTION. Go into mysql and run command like this

 GRANT ALL PRIVILEGES ON *.* TO 'myrootusernamehere'@'localhost' WITH GRANT OPTION;

This should fix your install issue.

Sherwin, I did what you told me and it solved the problem (creating the user).

However, the original problem recurred:

The OpenEMR (Installation) Setup Step 3 stops when trying to create table ‘created_date’ with error: “due to: Invalid default value for ‘created_date’”.

I did a fresh install with Hyper-V + LAMP (from TurnkeyLinux). Some problems arose but OpenEMR is already working.

I’m going to set up this instance and if all goes well, then I’ll install a VM with Ubuntu Server as a productive instance.

Thanks!

1 Like