0

i am new to php and getting error whole connecting to mysql as i have my sql install in my virtual machine having ip 192.168.1.104 and i am using this mysql in my machine server 2003 having ip 192.168.1.102 an i am successfully using it on server using mysql client but on server when i am trying to access mysql for php my making connection i am getting error...

here is the connection i mande for mysql from php,

<?php



$port = "3306";

$server = "192.168.1.104:".$port;

$dbname ="VideoResume";

$user = "root";

$pass = "nagios";



$conn = mysql_connect ($server, $user, $pass) or die ("Connection Error or Bad Port");



mysql_select_db($dbname) or die("Missing Database");



?

>

the error as i attach file with mysqlerror name

hopes to listen from you soon thanks in advance

Regards,

-syed mohsin razaEror in Connection are in this image

1
  • Search for the error message you got online and you will find a solution quick. Commented May 7, 2012 at 8:34

1 Answer 1

3

the error itself is clear that you need to reset root's password:

The commands are

UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
FLUSH PRIVILEGES;

you might want to take a look at

MySQL root user password

Sign up to request clarification or add additional context in comments.

6 Comments

There is also an ini setting that mysql accepts old passwords IIRC. And how should one execute that SQL you've posted if she/he can not connect to the database?
thanks a lot hakre for pointing it out , will definitely remember that the next time I opt to answer
@saya so i will update it after logging from root user at terminal and then run this query ?
remove old_passwords flag from my.cnf file
@saya i searched this file and find two file in which i freez this old pasw line with # so that it would work but error is same ?? i also restart mysql service
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.