I’m moving OpenEMR from Xampp on windows to a fresh Centos server. I moved the htdocs files and created the database on the new server. But when I access the new installation, I keep getting this error
"Check that mysqld is running.
ERROR: Could not connect to server!"
I checked to see if mysql and apache are running and if php is configured with mysql. I see the mysql entries in php_info() page. Anything else I’m missing? I also updated the sql_conf file in the sites/default folder.
This error occurs when 1) mysql is not running 2) the password is incorrect, 3) there is no password but you are trying to give it one. Usually the password on Windows is frequently blank - empty. In Linux the first thing that happens is that the administrator is advised to change the password.
In your system if the password was changed to some value at install on the CENTOS there would be a password mismatch because the database would be transfered without a password. Having an empty, absent or non-existent openemr database would cause this error.
Did you backup the Windows openemr database (perform a mysqldump) and restored it on CENTOS?
You will also need to copy the contents of the openemr/documents/ directory to the same directory on the Centos server.
Test the mysqld running in CENTOS.
type
mysql -u<username> -p<password> openemr
if that succeeds, then look for data.
select * from patients
would be a good test.
That will give you more info about “empty, absent or non-existent.” as Dr. Bowen suggests. However “could not connect” likely rules out “empty.”
If the windows box with mysql running is on the same network. you can also try editing the sqlconf.php to point at that machine. Just don’t do an “install” of the database when pointed at the windows box as can result in data loss when the install tries to build a baseline openemr schema.
As an aside, why CENTOS and not Ubuntu? Ubuntu is the generally chosen and most supported linux OS by the OpenEMR community. There is also the install package for Ubuntu.
When moving to a fresh server in the past I had to manually add the openemr user to the MySQL users. Importing the OpenEMR database to a fresh MySQL installation did not automatically add the openemr user to MySQL on the new machine.
BTW - I use SUSE Linux Enterprise Server 11. SUSE was my first intro to Linux from a friend plus I really like YaST.
I found out that the permissions for the emr user were empty. Everything worked fine after I used Mysql workbench to give ALL permissions to the emr user. For some reason, all the previliges I gave using mysql command line didn’t seem to stick!! Can anyone suggest what permissions are needed for openemr mysql user? I can think of update,select,insert,delete. I don’t want to assign ALL previligies to the openemr users but I’m not sure if it’s a good move security wise.
@yehster, I choose centos because I feel like Ubuntu is for personal use and Centos is more geared towards enterprises. I may be wrong??
@mike-h30. I actually started out with SUSE and I too absolutely love YaST but I moved away to Debian/CentOS because YaST and SUSE were dumbing me down. They do everything! and I wasn’t learning anything