Hi. Bit off-topic (ish) I know, however:
You are missing a semi-colon in the 'forum snippet'. The line: $conn = mysql_connect("localhost", "forums", "forumuser", "somepass") or die(mysql_error()) should be: $conn = mysql_connect("localhost", "forums", "forumuser", "somepass") or die(mysql_error()); As to the connection problem, you are putting the password into a variable called '$dbpassword' and passing a different (presumably null) variable '$dbpasswd' into mysql_connect. Thanks, Matt -----Original Message----- From: Lee Zelyck [mailto:[EMAIL PROTECTED] Sent: 21 March 2004 18:10 To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: Newbie Can't Add a User to MySQL Greetings Michael, Daniel, et al, Good news, I can get in! As evidenced below, however, my php forum script will not authenticate forumuser to insert data. Further, I tried to run a php/mysql authorization test, and still an error. I know this is not a php mailing list, but please find the problematic php snippets below, as well as the forumuser creation and authentication process. If somone could please point out my mistakes, that would be awesome! Thanks again, Lee TESTER ?php //Database connect script $dbhostname = "localhost"; $dbuser = "forumuser"; $dbpassword = "somepass"; $dbname = "forums"; $link = mysql_connect("$dbhostname", "$dbuser", "$dbpasswd") or die("Connection to server: $dbhostname FAILED!!!"); mysql_select_db("$dbname") or die("Connection to database: $dbname FAILED!!!"); ?> ERROR: Warning: Access denied for user: '[EMAIL PROTECTED]' (Using password: NO) in /var/www/dbtest.php on line 7 Warning: MySQL Connection Failed: Access denied for user: '[EMAIL PROTECTED]' (Using password: NO) in /var/www/dbtest.php on line 7 Connection to server: localhost FAILED!!! FORUM SNIPPET: //Connect to server and selectdatabase $conn = mysql_connect("localhost", "forums", "forumuser", "somepass") or die(mysql_error()) mysql_select_db("forums",$conn) or die(mysql_error()); ERROR: Parse error: parse error in /var/www/do_addtopic.php on line 13 For anyone that cares, forumuser was create and tested from the following commands: mysql> GRANT SELECT,INSERT,UPDATE ON *.* TO [EMAIL PROTECTED] -> IDENTIFIED BY 'somepass'; Query OK, 0 rows affected (0.00 sec) Spider:/usr/bin# mysql -u forumuser -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 44 to server version: 3.23.49-log Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> show databases; +----------+ | Database | +----------+ | forums | | mysql | | test | +----------+ 3 rows in set (0.00 sec) mysql> use forums; Database changed mysql> show tables from forums; +------------------+ | Tables_in_forums | +------------------+ | forum_posts | | forum_topics | +------------------+ 2 rows in set (0.00 sec) __________________________________ Do you Yahoo!? Yahoo! Finance Tax Center - File online. File on time. http://taxes.yahoo.com/filing.html -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]