Help with setup - error in Step 3

pec2 wrote on Friday, January 27, 2006:

Hello,
I am very new to openEMR, but very interested in using it.  I downloaded and installed all the necessary components (Apache, PHP, mysql, and openEMR).  I believe that Apache, PHP, and mysql are all successfully installed.  However, when I run the openEMR setup script, I get the following error at Step 3:

OpenEMR Setup

Step 3

Connecting to MySQL Server…
Warning: mysql_connect(): Can’t connect to local MySQL server through socket ‘/var/mysql/mysql.sock’ (2) in /Library/WebServer/Documents/openemr/setup.php on line 159
ERROR. Check your login credentials.
Can’t connect to local MySQL server through socket ‘/var/mysql/mysql.sock’ (2) (#2002)

I am attempting to run this on a Macintosh G4 running OS X (10.4.4).  From the command line, I can sucessfully login to mysql.  I would greatly appreciate any help that you can give me.  Thanks…

drbowen wrote on Friday, January 27, 2006:

Warning: mysql_connect(): Can’t connect to local MySQL server through socket ‘/var/mysql/mysql.sock’ (2)

This is an error message that usually is generated by MySQL and is not related to OpenEMR per se. It likely means that the MySQL server is not running.

Check that MySQL has been installed correctly and that the server has actually been started.

On a command prompt you shoulde be able to connect with

shell#  mysql  -u  root  -p

This will work only if the user root password has already been set.

If you have not set the MySQL root password, running:

shell#  mysql -u root

Should result in you connecting to the MySQL command interpreter it should look like this:

mysql>

The OpenEMR setup routine won’t work if you can’t connect like this.

Sam Bowen

drbowen wrote on Friday, January 27, 2006:

Have you set up the openemr database before running setup?

In the setup routine it is easiest to use the MySQL root user and password to setup the database.

You must put in a password for the openemr user.

The user you log in with will be quote admin close quotes or whatever you call the initial user.  The initial password is always - pass

Sam Bowen

drbowen wrote on Friday, January 27, 2006:

There is a thread that others have had this problem with certain verssons of OS X.  Look at :

http://www.macosxhints.com/article.php?story=20060111113313511&lsrc=osxh

The suggested fix is:

$ sudo mkdir /var/mysql
$ sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock

But take a look at the whole thread.

Sam Bowen