Koozali.org: home of the SME Server

Trouble with MySQL

zach_fleming

Trouble with MySQL
« on: August 18, 2004, 12:35:20 PM »
I cannont log into phpmyadmin with root or admin.
cannot access any database's from php scripts in my websites.

cannot do, well pretty much anything with mysql.

is there something i need to do before i can use it with my own databases? or should it just work?



SPECS:
SME 5.6
P2 400MHZ
512MB
2x 10gb HDDs
2x Intel Pro100 NICs

Garfield

Trouble with MySQL
« Reply #1 on: August 18, 2004, 01:41:17 PM »
Is that locally on the SME server or remote ?

Per default, MySQL accpets only connections locally on the server.

Here's what I do after a fresh install:

1. Enable remote access:

# /sbin/e-smith/config setprop mysqld LocalNetworkingOnly no
# /sbin/e-smith/expand-template /etc/my.cnf
# /etc/rc.d/init.d/mysqld restart

2. Create new user to do my admin work in MySQL:

GRANT ALL ON * TO admin@localhost IDENTIFIED BY “password” WITH GRANT OPTION;
GRANT ALL ON * TO admin@”%” IDENTIFIED BY “password” WITH GRANT OPTION;

And finally, because I use PHP includes form y DB-connections located OUTSIDE the website tree, I do the following:

* Create directory php under /usr/share
* Chown admin php, chgrp shared php
* Put includes in /usr/share/php
* Chown admin *, chgrp shared * (from within /usr/share/php)
# mkdir /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf
# cp /etc/e-smith/templates/etc/httpd/conf/httpd.conf/95AddType00PHP2ibays /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/95AddType00PHP2ibays
* Change the line reading "php_admin_value open_basedir $basedir\n"; to "php_admin_value open_basedir $basedir:/usr/share/php\n";
# /sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
# apachectl restart

Hope this helps.

PS: I don't use phpMyAdmin myself. I work on the cmd line via PuTTY and I use MySQLFront an MySQL Control Centre.

PPS: It's amazing what you can find using the search function on this site  :-D .

zach_fleming

Trouble with MySQL
« Reply #2 on: August 19, 2004, 12:57:55 AM »
everything i do as far as my websites go is locally on my sme box so i'm asuming all i need to do is create a new user? or should i enable remote access as well?

Garfield

Trouble with MySQL
« Reply #3 on: August 19, 2004, 07:24:32 AM »
Well the least you should do is create the appropriate user(s) and databases(s) on your system. And if everything happens locally, then you don't need to enable remote access and if you don't use inlcudes located outside your website tree then you also don't need to customize the configuration for that.

zach_fleming

Trouble with MySQL
« Reply #4 on: August 19, 2004, 09:24:07 AM »
thanx for your help. i'm starting a new job tommorow so i dont think ill get much chance to have too much of a play with it for a week or so.

ill keep you informed all the same.

thank you for your help

regards


Zach