What error are you getting? My problem when moving to 4.1 was
forgetting that I was using an older MySQL client.
I'm not positive, but I think that in order to connect to MySQL 4.1
with PHP you need to use the mysqli functions, not mysql, and mysqli
requires PHP 5.
If you want to keep using MySQL 4.1 with PHP 4, then try changing your
user's password with the OLD_PASSWORD() function.
http://dev.mysql.com/doc/mysql/en/Encryption_functions.html
Wes
On Aug 13, 2004, at 9:48 AM, leegold wrote:
> I can connect in the php by using 'root' and the root pw. But when I
> tried adding a user ( sarah ) with GRANT I cannot connect from php. The
> php is simple, what am I overlooking? Again putting the root user name
> and pw it'll work in php but not for sarah:
>
> the php....
> mysql_pconnect("localhost","sarah","camera")
> or die("ERROR: Could not connect to database!");
> mysql_select_db("howto");
>
> *But* on the command line the sarah user works OK:
>
> C:\Documents and Settings\Administrator>mysql -u sarah -p
> Enter password: ******
> Welcome to the MySQL monitor. Commands end with ; or \g.
> Your MySQL connection id is 19 to server version: 4.1.3a-beta-nt-max
>
> Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
>
> mysql> select * from howto.page;
> +---------+-----------------------------+
> | page_id | page_url |
> +---------+-----------------------------+
> | 1 | http://www.lg.netfarms.org |
> +---------+-----------------------------+
> 1 row in set (0.00 sec)
>
> mysql> show grants for sarah@localhost;
> +----------------------------------------------------------------------
> -------------------------------------------------+
> | Grants for sarah@localhost
> |
> +----------------------------------------------------------------------
> -------------------------------------------------+
> | GRANT ALL PRIVILEGES ON *.* TO 'sarah'@'localhost' IDENTIFIED BY
> PASSWORD '*6043233C67ADBE7E9242089D718763C3C5E1A1E2' |
> +----------------------------------------------------------------------
> -------------------------------------------------+
> 1 row in set (0.00 sec)
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/mysql?unsub=1
>
>
| Thread |
|---|
| • Can connect with PHP to MYSQL | leegold | 13 Aug |
| • Re: Can connect with PHP to MYSQL | suomi | 13 Aug |
| • Re: Can connect with PHP to MYSQL | Wesley Furgiuele | 13 Aug |
| • Re: Can connect with PHP to MYSQL | leegold | 13 Aug |
| • Re: Can connect with PHP to MYSQL | Andreas Ahlenstorf | 13 Aug |
| • SQL question, SELECT DISTINCT | leegold | 16 Aug |
| • Re: SQL question, SELECT DISTINCT | SGreen | 16 Aug |
| • Re: SQL question, SELECT DISTINCT | leegold | 16 Aug |
| • T-SQL SUM() Overflow? | David Mohorn | 16 Aug |
| • Re: SQL question, SELECT DISTINCT | SGreen | 16 Aug |
| • Re: SQL question, SELECT DISTINCT | leegold | 16 Aug |
| • Re: SQL question, SELECT DISTINCT | Michael Stassen | 16 Aug |
| • RE: T-SQL SUM() Overflow? | Martin Gainty | 16 Aug |
| • Re: SQL question, SELECT DISTINCT | leegold | 16 Aug |
| • Re: SQL question, SELECT DISTINCT | Michael Stassen | 16 Aug |
| • Re: SQL question, SELECT DISTINCT | leegold | 16 Aug |
| • Re: SQL question, SELECT DISTINCT | leegold | 16 Aug |
| • Re: SQL question, SELECT DISTINCT | Stephen E. Bacher | 17 Aug |
| • Re: SQL question, SELECT DISTINCT | Michael Stassen | 17 Aug |