Setup error "unable to connect to database as root"

hi @anton ,
For the password to the openemr mysql user, look in your sites/default/sqlconf.php script.
-brady

Thanks @brady.miller!
There was indeed a random password which I never gave by myself, and it works.
Cheers!

I have been trying to get OpenEMR running on my FreeBSD box, and I ran into the “unable to connect to database as root” message. I am happy to report I have found TWO ways to get around this message.

  1. In the MySQL Server Details->Server Host: field use 127.0.0.1 instead of localhost
  2. Add the following lines to your php.ini file (note these values are specific for FreeBSD):

mysqli.default_socket = /var/run/mysql/mysql.sock
pdo_mysql.default_socket = /var/run/mysql/mysql.sock

Note that #2 “fixes it” so that leaving the default value of “localhost” will work. This has the side benefit of fixing OTHER php based utilities such as phpMyAdmin.

I hope this is helpful.

2 Likes