MySQL cannot be installed in win7.
My problem is that the original service is retained in Windows 7 because it has not been uninstalled. As a result, subsequent installation and startup services fail.
Another reason: MySQL data in programdata is not deleted. programdata is in C:, and information previously installed in MySQL needs to be deleted.
Finally, you can delete the service through the registry. Of course, MySQL services can be deleted through the DOS command...
Start Apache. After MySQL service is started, you can see
<? PHP $ connect = mysql_connect ("localhost", "root", "123456"); If (! $ Connect) echo "MySQL connect error! "; Else echo" I love my life, I love wangjuan! "; Mysql_close ();?>
Yes.
But I found that at the beginning of win7, I only knew localhost, that is, in the address bar, only localhost can be input for printing.
I love my life, I love wangjuan! If you enter 127.0.0.1 or print it works! Later, the hosts file under c: \ windows \ system32 \ drivers \ etc was modified, and the line 127.0.0.1 localhost was added, then, add 127.0.0.1 in the address bar to print the above I love my life, I love wangjuan! Because the hosts file is a system file and is a hidden file, you need to modify the folder option to see it. In addition, you need the administrator privilege to modify it.