Re: [PHP-DB] Mysql autentication problem

2007-03-02 Thread Ted Fines

Hi,

So it works from PHP w/o a password, but with a password does not?  What are
you using for a password?  I don't mean post it here, but are there any
'funny' characters in it?  I've had trouble because of that before, on other
systems.  Try a dumb, obviously OK password, like 'apples' and see if that
works.  Increase the password complexity from there...

Ted

On 3/2/07, Roberto F Tavares Neto [EMAIL PROTECTED] wrote:


Hello,

I'm trying to do a very simple thing: create a database and a user to
use it.

So, initially, I use the web interface phpmyadmin. Logged as root, I
created the database, and the user with some password.

But, I could not login using phpmyadmin. Either any php-based system
could connect to the BD.

So, I make sure that I got the [EMAIL PROTECTED] and [EMAIL PROTECTED] 
created,
with permissions and same password. Nothing.

But I *can* log on mysql shell.

One more info: when the user is set without password, it works fine on
PHP.


Does anyone can give me a clue of what is happening?

Thanks!

Roberto

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] Mysql autentication problem

2007-03-02 Thread Ted Fines

Hi,

When you're connecting from your PHP script, are you connecting from the
same machine that the db is on, or a different one?  If a different one,
you'll need to do grant commands like:
grant all privileges on mydbname.* to 'mydbuser'@'myhostname.mycompany.net'
identified by 'mypassword';

Ted
On 3/2/07, Roberto F Tavares Neto [EMAIL PROTECTED] wrote:


Ted,

I try the classic abc and had the same problem...

Roberto

Ted Fines escreveu:
 Hi,

 So it works from PHP w/o a password, but with a password does not?
 What are
 you using for a password?  I don't mean post it here, but are there any
 'funny' characters in it?  I've had trouble because of that before, on
 other
 systems.  Try a dumb, obviously OK password, like 'apples' and see if
 that
 works.  Increase the password complexity from there...

 Ted

 On 3/2/07, Roberto F Tavares Neto [EMAIL PROTECTED] wrote:

 Hello,

 I'm trying to do a very simple thing: create a database and a user to
 use it.

 So, initially, I use the web interface phpmyadmin. Logged as root, I
 created the database, and the user with some password.

 But, I could not login using phpmyadmin. Either any php-based system
 could connect to the BD.

 So, I make sure that I got the [EMAIL PROTECTED] and [EMAIL PROTECTED] 
created,
 with permissions and same password. Nothing.

 But I *can* log on mysql shell.

 One more info: when the user is set without password, it works fine on
 PHP.


 Does anyone can give me a clue of what is happening?

 Thanks!

 Roberto

 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php





--


Roberto Fernandes Tavares Neto
Prof. Assistente
Departamento de Engenharia de Produção
Universidade Federal de São Carlos
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]  tel +55 16
3351-9240
http://www.dep.ufscar.br/docentes_desc.php?uid=165





[PHP-DB] mysql_connect problem

2006-12-09 Thread Ted Fines

Hi,

I've setup an Apache 2.2.3, PHP 5.2.0, MySQL 5.0.27 on a Solaris 9 system.

The install appeared to go well.  To test the Apache/PHP/MySQL integration,
I added a simple test.php to the Apache document folder, consisting of:

?php
phpinfo();
?

When I access the URL/test.php, it displays as expected.  That is, I see the
PHP version, date, configure command and detail about all of the modules,
including curl, gd, IMAP, and MySQL.  Looks like a perfectly normal
rendition of phpinfo().  So it looks great, like everything works.

But then I try to load a web app on the server, like SMF or phpBB, they both
tell me that I don't have MySQL configured.

I don't understand why the phpinfo() command would show the MySQL config
info, yet the web apps would think that MySQL was not configured.

So I created another test php file, mysqltest.php, with these lines:
?php
$link = mysql_connect('localhost', 'testuser', '***');
if (!$link) {
  die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?

Now, as testuser, I can login to the database using the command line mysql
-u testuser -p and entering the password.

But when I try accessing the above file, I get no output in the browser, but
in the apache errlog file, I get:
PHP Fatal error:  Call to undefined function:  mysql_connect() in
/opt/apache-php/apache/htdocs/mysqltest.php on line 2

So it looks like my PHP install just doesn't even know about the
'mysql_connect' function.
extensions_dir = /opt/apache-php/php4/lib/php/extensions, and that dir does
contain the mysql.so file.  If I move it out of that folder and rerun
phpinfo(), it displays without showing any MySQL config data.

Any help?  I'm just stuck!  My directive for MySQL inclusion for the PHP
./configure command was:
--with-mysql=shared,$BLIB/mysql

...where $BLIB was set to /opt/apache-php/libs

Thanks,
Ted