|
Posted by Daedalus.OS on 10/01/58 11:30
Before going further let's check the basic: Are you sure the username and
password are right ? And are you sure that this user have the rights to
connect to the database from localhost or 127.0.0.1 ?
Dae
"Zoe Brown" <zoenaomibrown@N-O-S-P-A-A-Mtesco.net> wrote in message
news:hOI7f.15213$65.12260@newsfe6-win.ntli.net...
>I am new to PHP and mysql.
>
> I am trying to create a database with just one table. How do I setup the
> username and password ?
>
> I am trying to run a script like this
>
> $user="username";
> $password="password";
> $database="database";
> mysql_connect(localhost,$user,$password);
> @mysql_select_db($database) or die( "Unable to select database");
> $query="CREATE TABLE contacts (id int(6) NOT NULL auto_increment,first
> varchar(15) NOT NULL,last varchar(15) NOT NULL,phone varchar(20) NOT
> NULL,mobile varchar(20) NOT NULL,fax varchar(20) NOT NULL,email
> varchar(30) NOT NULL,web varchar(30) NOT NULL,PRIMARY KEY (id),UNIQUE id
> (id),KEY id_2 (id))";
> mysql_query($query);
> mysql_close();
>
> but am getting the error
>
> "Warning: Access denied for user: 'username@127.0.0.1' (Using password:
> YES) in c:\phpdev\www\work\budget\guava\database\create.php on line 7
>
> Warning: MySQL Connection Failed: Access denied for user:
> 'username@127.0.0.1' (Using password: YES) in
> c:\phpdev\www\work\budget\guava\database\create.php on line 7
> Unable to select database"
>
> Zoe
>
Navigation:
[Reply to this message]
|