Jump to content

PHP will not connect to mysql - SYSTEM@localhost issue


barry6628

Recommended Posts

Hi thanks for your help

 

I have trid to set password did this at mysql> mysql -u root mysql

                                                          >SET PASSWORD FOR root@localhost=PASSWORD('24086628');

                                                          >FLUSH PRIVILEGES;

 

I still get the same problem. Am I setting the wrong password??

 

Regards

 

Barry

 

Link to comment
Share on other sites

Hi thanks again for etting back to me.

 

Im sorry for being dumb with this. Ive set a new data base called it company Ive created a table called it employee with the following (and this was out of the book) empID a firstname a lastname an email a phone and a PRIMARY KEY.

I granted all rights to barrymd@localhost and checked that had registered .

 

I dont understand 

Access denied for user 'SYSTEM'@'localhost' (using password: NO)

 

why does this denial talk about SYSTEM@localhost when Im tring to access barrymd@localhost

 

Regards

 

Barry

Link to comment
Share on other sites

I think as I learn more Im gettin nearee the answer. I switched on

 

Display_startup_erroes = on

 

Restarted Apache and got the following:

 

Unable to load dynamic library C:\php5\ext\c:\php5\ext\ The specified module could not be found.

 

Were is this set??

 

Also c:\php5\ext php_sqlite.dll The specified module could not be found.

 

Regards

 

Barry

 

 

Link to comment
Share on other sites

Hi thanks thats stoped the start up problems but ive still got the original problem about connecting

 

Access denied for user 'SYSTEM'@'localhost' (using password: NO) The bit I dont get is the SYSTEM how do I put a pssword on to the SYSTEM??

 

Thanks agin for staying with me I know together we will win.

 

Regards

 

Barry

 

Link to comment
Share on other sites

Hi here is the code Ive tried.

 

<?php

 

$username = "barrymd@localhost";

$password = "24086628";

$hostname = "localhost";

 

mysql_connect($hostname,$username,$password) or die("Could not connect to server:<br />" . mysql_error());

 

echo "connected";

 

mysql_select_db("company") or die( "Unable to select database:<br />" . mysql_error());

 

echo "selected db";

 

$query = "INSERT INTO employee VALUES ('','$first','$last','$phone','$mobile','$fax','$email','$web')";

mysql_query($query) or die( "Unable to run query (<tt>$query</tt>:<br />" . mysql_error());

 

mysql_close();

 

echo "all done";

?>

 

Regards

 

Barry

 

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.