Subject: Re: can't connect to mysql from php ,NetBSD 3.0
To: None <port-cobalt@netbsd.org>
From: Jahislove <jahislove@wanadoo.fr>
List: port-cobalt
Date: 03/19/2006 16:35:30
i don't know what rights i must have , so here is all i have found

/var
drwx------   7 mysql   wheel      512 Mar 10 23:40 mysql

/var/mysql
-rw-rw----  1 mysql  wheel   5242880 Mar 10 23:40 ib_logfile0
-rw-rw----  1 mysql  wheel   5242880 Mar  4 10:49 ib_logfile1
-rw-rw----  1 mysql  wheel  10485760 Mar 10 23:39 ibdata1
drwx------  2 mysql  wheel       512 Mar  9 12:13 compteur
drwx------  2 mysql  wheel      1536 Mar  4 10:42 mysql
drwx------  2 mysql  wheel       512 Mar  4 10:42 test
drwx------  2 mysql  wheel       512 Mar  9 12:01 nb_connect

all files in sub directory are 660

# ps aux |grep mysql
root 524 /bin/sh /usr/pkg/bin/mysqld_safe --user=mysql 
--datadir=/var/mysql ...
mysql 619 /usr/pkg/libexec/mysqld --basedir=/usr/pkg 
--datadir=/var/mysql --user=mysql ...



Evgueni Tzvetanov a écrit :
> Check the permissions of the database directory
> (possibly /var/lib/mysql) and the permissions of the
> files themselves. Check also as what user is mysqld
> running.
> 
> ET
> 
> --- Jahislove <jahislove@wanadoo.fr> wrote:
> 
>> hello all ,
>>
>> i am under NetBSD 3.0
>> and i have installed apache/php/mysql as described
>> on this wiki
>>
> http://wiki.onetbsd.org/index.php/How_to_install_a_LAMP_Server
>> /usr/pkgsrc/www/apache2
>> /usr/pkgsrc/databases/mysql5-server
>> /usr/pkgsrc/www/ap-php      (Installing the PHP
>> Module for Apache)
>>
>> apache work fine
>> php work fine
>> mysql work fine
>>
>> but it seem that i can't access database from a php
>> script
>>
>> this little script (test.php) return  only "test1"
>> and not "test2"
>>
>> <?php
>> $host = "localhost";
>> $login = "compteur";
>> $password = "xxxxxx";
>> $database = "compteur";
>> $table = "nb_connect";
>>
>> echo "test1";
>>
>> $db = mysql_connect($host, $login, $password)
>> or die("Impossible de se connecter :
>> ".mysql_error());
>>
>> echo "test2";
>>
>> mysql_select_db($database,$db);
>>
>> mysql_query("INSERT INTO $table
>> VALUES('','blabla','30')")
>> or die("error : ".mysql_error());
>>
>> $update = mysql_insert_id();
>> mysql_close($db);
>> ?>
>>
>>
>> any idea of the problem?
>> is it possible that the ap-php isn't working and i
>> must install a 
>> php-mysql module?
>>
>>
>>
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
>