How do I edit sqlconf.php?

subera wrote on Friday, April 15, 2005:

I read about this program in AMA News and thought I would try it out.  I’ve spent the last week learning about Linux, etc.  So I’m a Linux noob.  I have 10.1 installed fresh.  I have downloaded Firefox and installed it.  I ran setup.php for openemr and entered a name for my clinic, my name, user and password.  Went pretty smooth considering Linux is new to me.

Unfortunately, It won’t let me log in with anything.  I cant log in as myself or as Admin with Pass.  the screen just refreshes.

When I try to rerun setup i am locked out:

“OpenEMR is already configured. If you wish to re-configure the SQL server, edit library/sqlconf.php, or change the ‘config’ variable to 0, and re-run this script.”

Can someone please tell me how to edit that file or make recommendations?  Thanks in advance.

LS

subera wrote on Friday, April 15, 2005:

Typo to the above:  I tried "admin" and  "pass" like on the log in page.  Not caps like above.  My bad. 

To clarify I know how to edit.  I’m not finding the correct config file with Find.  Thanks

drbowen wrote on Friday, April 15, 2005:

We need to know which distribution of linux you are using? (Mandrake, Debian, RedHat, Fedora Core, Suse, Slackware)

Does the login screen list a initial group?

Does it list a textboxes for a username and a password?

sqlconf.php is usually is located in the (depends on the distribution) web root:

/var/www/html/openemr/library/sqlconf.php

Open the sqlconf.php with a text editor and look for

>
> <?
> //  OpenEMR
> //  MySQL Config
> //  Referenced from sql.inc
>
> $host   = ‘localhost’;
> $port   = ‘3306’;
> $login  = ‘openemr’;
> $pass   = ‘openemr’;
> $dbase  = ‘openemr’;
>
>
> $sqlconf = array();
> $sqlconf[“host”]= $host;
> $sqlconf[“port”] = $port;
> $sqlconf[“login”] = $login;
> $sqlconf[“pass”] = $pass;
> $sqlconf[“dbase”] = $dbase;
> //////////////////////////
> //////////////////////////
> //////////////////////////
> //////DO NOT TOUCH THIS///
> $config = 1; /////////////

>
Alter the

$config = 1; /////////////

to read

$config = 0; /////////////

will allow you to start from scratch and try again.

In a pinch you can probable just edit this file by hand.  Change the openemr to your mysql login name, password and database.

$login  = ‘openemr’;
$pass   = ‘openemr’;
$dbase  = ‘openemr’;

Alter the

$config = 0; /////////////

to read

$config = 1; /////////////

Logging in for the first time will be username =  admin

and the password will be =  pass

(Unless you changed the value of the initial username logging in during setup.

Make sure that the mysqld is actually running.  You should be able to log in to the mysql server using the root username and password with :

$  mysql  -u  root  -p
enter your password:

And if everything is setup correctly:

$  mysql  -u  openemr -p openemr

Sam Bowen, MD

drbowen wrote on Friday, April 15, 2005:

“OpenEMR is already configured. If you wish to re-configure the SQL server, edit library/sqlconf.php, or change the ‘config’ variable to 0, and re-run this script.”

The reference to config is inside sqlconf.php and not accessible to the find command.

I think the process must be different in version 5.0.2. I found sqlconf.php at /var/www/html/openemr/library, but it has no line for $config. It says “database parameters are now site-specific. $GLOBALS [OE_SITE_DIR] is set in interface/globals.php” (this is despite the message on the setup screen alerting me to OpenEMR being already installed and to just edit the $conf line in sqlconf.php). Is there another way?

hi @Chrys_Ostrander, try sites/<site-id>/sqlconf.php where site-id is usually defaulted to default

1 Like

good evening, i try to set OpenEMR OAuth2 , and i encounter this error

Fatal error : require_once(): Failed opening required ‘C:/SONGMA-V1/htdocs/songma/sites/songma/sqlconf.php’ (include_path=‘C:\SONGMA-V1\htdocs\songma\vendor/pear/archive_tar;C:\SONGMA-V1\htdocs\songma\vendor/pear/console_getopt;C:\SONGMA-V1\htdocs\songma\vendor/pear/pear-core-minimal/src;C:\SONGMA-V1\htdocs\songma\vendor/pear/pear_exception;C:\SONGMA-V1\php\PEAR’) in C:\SONGMA-V1\htdocs\songma\library\sqlconf.php on line 14
can you help me please?