By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,949 Members | 1,824 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,949 IT Pros & Developers. It's quick & easy.

PHP+MySQL doubt

P: n/a
I would like to know how can I know if I need to use a password in a
MySQL DB connection like this one
mysql_connect($this- host, $this- dbuser, $this- dbpass), because my
server doesn't need the password, but others do.
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
*** Juan Gabito wrote/escribió (21 Jun 2004 11:00:23 -0700):
I would like to know how can I know if I need to use a password in a
MySQL DB connection like this one
mysql_connect($this- host, $this- dbuser, $this- dbpass), because my
server doesn't need the password, but others do.


That's part of the information your hosting company should give you. If
your database didn't have a password, anyone could read, modify and delete
your data!

--
--
-- Álvaro G. Vicario - Burgos, Spain
--
Jul 17 '05 #2

P: n/a
ga******@internet.com.uy (Juan Gabito) wrote in message news:<ff**************************@posting.google. com>...
I would like to know how can I know if I need to use a password in a
MySQL DB connection like this one
mysql_connect($this- host, $this- dbuser, $this- dbpass), because my
server doesn't need the password, but others do.


In MySQL:

mysql> SELECT Host, User, Password FROM mysql.user;
Then check defined users here.
Or in your PHP script:

$link = mysql_connect($this->host, $this->user, '')
or die('Oh yes. I need a password here.' . mysql_error());
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.