Installation Shared Hosting CPANEL

Situation
Unabvle to install on a shared hosting via CPANEL

OpenEMR Version
I’m using OpenEMR version

Browser:
I’m using: Chome

Operating System
I’m using: Win11 PC, Standard LAMP Stack on CPANEL

Search
Yes

Logs
Did you check the logs? Yes
Was there anything pertinent in them? No
Please paste them here (surround with three backticks (```) for readability.
You can also turn on User Debugging under Administration->Globals->Logging User Debugging Options=>All

I have created my own databases, but when I try to install I get the following error:

Connecting to MySQL Server… OK.
ERROR. unable to execute SQL: ‘CREATE TABLE `contact` ( `id` BIGINT(20) NOT NULL auto_increment, `foreign_table_name` VARCHAR(255) NOT NULL DEFAULT ‘’, `foreign_id` BIGINT(20) NOT NULL DEFAULT ‘0’, PRIMARY KEY (`id`), KEY (`foreign_id`)) ENGINE = InnoDB’ due to: Table ‘contact’ already exists

I have tried everything including reading all the documentation I can find, checking Videos etc,. but no luck. I have made the recommended PHP changes. I have also tried Openemr create the databases for me but that doesn’t work either.

I am working through CPANEL using the standard tools.

Can anyone help please?

Are you trying to install using the master dev branch of OpenEMR?

If not what version?

Thankyou, I am trying to install using:
openemr-7.0.3.tar.gz

Downloaded from here: OpenEMR Downloads - OpenEMR Project Wiki

Okay, so you start install with an empty database that you create using utf8mb4_general_ci collation, if so, you shouldn’t error however if you attempted previously to install and trying to install to same database then it would fail.

Delete DB nd retry.

Looking over database.sql it should actually drop the table if exist so I’m a little confuse! What was the exact sequence you followed to get the error.

DROP TABLE IF EXISTS `contact`;
CREATE TABLE `contact` (
   `id` BIGINT(20) NOT NULL auto_increment,
   `foreign_table_name` VARCHAR(255) NOT NULL DEFAULT '',
   `foreign_id` BIGINT(20) NOT NULL DEFAULT '0',
   PRIMARY KEY (`id`),
   KEY (`foreign_id`)
) ENGINE = InnoDB;

Hi, I have deleted the database and tried again 3 times and receive the same error. The newly created databases are empty. If I try and have OPENEMR create the database I receive the following error: Connecting to MySQL Server… ERROR. Check your login credentials. unable to connect to database as root


Attached is the install screen

For the mysql server login ou need to use the account login credentials. So do you have an account openemr_pacific?

You might try using the root account if exposed.

Next I’d try using openemr as database

Root isn’t exposed unfortunately

Didn’t answer if you have account openemr_pacific with proper grants to create etc.

The user openemrt_pacific has full privileges

Sorry you need to work out app access to server otherwise the install works and I don’t know how I can help further.

I have now gone back to using the database openemr and the username openemr and now get the following error:

Connecting to MySQL Server… OK.

ERROR. unable to execute SQL: ‘CREATE TABLE history_data ( id bigint(20) NOT NULL auto_increment, uuid binary(16) DEFAULT NULL, coffee longtext, tobacco longtext, alcohol longtext, sleep_patterns longtext, exercise_patterns longtext, seatbelt_use longtext, counseling longtext, hazardous_activities longtext, recreational_drugs longtext, last_breast_exam varchar(255) default NULL, last_mammogram varchar(255) default NULL, last_gynocological_exam varchar(255) default NULL, last_rectal_exam varchar(255) default NULL, last_prostate_exam varchar(255) default NULL, last_physical_exam varchar(255) default NULL, last_sigmoidoscopy_colonoscopy varchar(255) default NULL, last_ecg varchar(255) default NULL, last_cardiac_echo varchar(255) default NULL, last_retinal varchar(255) default NULL, last_fluvax varchar(255) default NULL, last_pneuvax varchar(255) default NULL, last_ldl varchar(255) default NULL, last_hemoglobin varchar(255) default NULL, last_psa varchar(255) default NULL, last_exam_results varchar(255) default NULL, history_mother longtext, dc_mother text, history_father longtext, dc_father text, history_siblings longtext, dc_siblings text, history_offspring longtext, dc_offspring text, history_spouse longtext, dc_spouse text, relatives_cancer longtext, relatives_tuberculosis longtext, relatives_diabetes longtext, relatives_high_blood_pressure longtext, relatives_heart_problems longtext, relatives_stroke longtext, relatives_epilepsy longtext, relatives_mental_illness longtext, relatives_suicide longtext, cataract_surgery datetime default NULL, tonsillectomy datetime default NULL, cholecystestomy datetime default NULL, heart_surgery datetime default NULL, hysterectomy datetime default NULL, hernia_repair datetime default NULL, hip_replacement datetime default NULL, knee_replacement datetime default NULL, appendectomy datetime default NULL, date datetime default NULL, pid bigint(20) NOT NULL default ‘0’, name_1 varchar(255) default NULL, value_1 varchar(255) default NULL, name_2 varchar(255) default NULL, value_2 varchar(255) default NULL, additional_history text, exams text, usertext11 TEXT, usertext12 varchar(255) NOT NULL DEFAULT ‘’, usertext13 varchar(255) NOT NULL DEFAULT ‘’, usertext14 varchar(255) NOT NULL DEFAULT ‘’, usertext15 varchar(255) NOT NULL DEFAULT ‘’, usertext16 varchar(255) NOT NULL DEFAULT ‘’, usertext17 varchar(255) NOT NULL DEFAULT ‘’, usertext18 varchar(255) NOT NULL DEFAULT ‘’, usertext19 varchar(255) NOT NULL DEFAULT ‘’, usertext20 varchar(255) NOT NULL DEFAULT ‘’, usertext21 varchar(255) NOT NULL DEFAULT ‘’, usertext22 varchar(255) NOT NULL DEFAULT ‘’, usertext23 varchar(255) NOT NULL DEFAULT ‘’, usertext24 varchar(255) NOT NULL DEFAULT ‘’, usertext25 varchar(255) NOT NULL DEFAULT ‘’, usertext26 varchar(255) NOT NULL DEFAULT ‘’, usertext27 varchar(255) NOT NULL DEFAULT ‘’, usertext28 varchar(255) NOT NULL DEFAULT ‘’, usertext29 varchar(255) NOT NULL DEFAULT ‘’, usertext30 varchar(255) NOT NULL DEFAULT ‘’, userdate11 date DEFAULT NULL, userdate12 date DEFAULT NULL, userdate13 date DEFAULT NULL, userdate14 date DEFAULT NULL, userdate15 date DEFAULT NULL, userarea11 text, userarea12 text, created_by BIGINT(20) DEFAULT NULL COMMENT ‘users.id the user that first created this record’, PRIMARY KEY (id), KEY pid (pid), UNIQUE KEY uuid (uuid)) ENGINE=InnoDB AUTO_INCREMENT=1’ due to: Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.

You might look into your host sql engine setup and version. Tested on 10.4.32-MariaDB - mariadb.org binary distribution

I have read through even other people’s answers inorder to assist, alright kindly invo I can have this OpenEMR installed for you on your shared hosting

Hi all,

Regarding cPanel: I previously faced this error, and I was able to resolve it. I’ve done several installations using shared web hosting, and I’ve encountered this issue 2–3 times.

What worked for me was the following:

  1. When creating the database, cPanel generates an auto password.

    • Save the database username and password somewhere safe.

    • Make sure you assign the user to the database and grant ALL privileges.

  2. When entering the database details (database name, username, host, port, etc.), I noticed that hidden characters can sometimes cause issues—especially after copy/paste.

    • To fix this, click into each field, add a single space, then delete it.

    • Do this for all database-related fields.

  3. If the password still causes an error, even when typed manually:

    • Change/reset the MySQL user password from cPanel.

    • Then re-enter the new password, and repeat the space + delete step again before saving.

This approach has consistently fixed the issue for me on shared hosting.

INBOX mukisadaren19@gmail.com whatsapp#+256766304302