Koozali.org: home of the SME Server

How to setuo mySQL db in SME6.5 to run a PHP Script??

pcparts2go

How to setuo mySQL db in SME6.5 to run a PHP Script??
« on: December 26, 2005, 11:39:42 PM »
Hi can anyone give me information about mySQL in SME
6.5? I have a PHP script I want to install. I need to know mySQL information on
the server.

 ### Database Name
$dbname = 'databasename';

### Database Hostname or IP
$dbhost = 'localhost';

### Database Username
$dbusername = 'username';

### Database Password
$dbpassword = 'pass';

### Database Prefix, so tables dont collide
$dbprefix = 'class_';

### Cookie Prefix
$cookieprefix = "class_";      Thank you in advance, I'd appreciate any help offered thanks. pcparts2go :-?

Damian

How to setuo mySQL db in SME6.5 to run a PHP Script??
« Reply #1 on: December 27, 2005, 11:38:44 PM »
By default MySQL on SME has no password for user root so you could use that one.
However, to use the built-in MySQL DB for user apps you'll need to listen to the network socket. To do that do something like (all the following logged in as root) ...

/sbin/e-smith/db configuration setprop mysqld LocalNetworkingOnly no
/sbin/e-smith/expand-template /etc/my.cnf
/sbin/service mysqld restart

Don't guarantee it works on 6.5 but I think it might ;o)

Having said that, why not create a new user (once you've done the above) for your app. Something like:

mysql

grant all on mydbname.* to myuser@localhost identified by 'mypassword';

(and log out with) ^D

Then feed that info into your php script.

Damian