hi.
i am senthilmurugan. i am learning to php language.
one error occur. i try to connect to database.
Can't connect to MySQL server on 'localhost' (10061). how to correct the error .
please reply the answer...
muruganasm 0 Newbie Poster
Recommended Answers
Jump to Posthi!
Just write according to my code.I think that will work.<?php $host="localhost"; $user="root" //It may different $pass="" //If u use password that write between " " $database="test" //you can also use any any created database name. @mysql_connect($host,$user,$pass) or die("Sorry ,User name Or Password problem); @mysql_select_db($database); //What's …
Jump to PostYou might want to check with your hosting company about the MySQL connection. Not all hosting companies allow you to connect via localhost.
With GoDaddy and some others the MySQL database resides on a different server so they use a different sever name.
All 5 Replies
dr4g 25 Junior Poster
mayacn 0 Newbie Poster
sumchtarek 0 Newbie Poster
TopDogger 5 Junior Poster in Training
alza 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.