Hi! I want to connect to mysql server that is installed on my pc and works from php script. I use the wampserver and all the severs works . but from some reasom when i write this script: <?php $mysql_link= mysql _connect('local','','') or die("ERROR:cannot connect"); echo "connected successfully to MySQL server."; mysql_close($mysql_link); ?> PHP: it keep sys access is denid. i do not have user name or password to the server and everything works through the consol than what can be wrong? need your help progfrog
mysql _connect('local','','') change it to mysql _connect('local','root','') root is the default user with no password. It's ok to use it on local test servers. But always create different users with passwords in live environment!
Uhm... there shouldn't be a space between 'mysql' and the underscore. mysql_connect not mysql _connect...
might i recommend adodb.sourceforge.net before you start writing large applications? if you ever need to move to something else than mysql you'll be very happy if u use adodb..
I think you need to make it look like this to get it working: It is localhost and user root with no password in your case though I do suggest you assign a password to root even on your local machine.