Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't connect to Database server

Status
Not open for further replies.

ehmer

Technical User
Nov 21, 2003
2
AU
I have installed MySQL on WinXP Pro

When attempting to access various commands from the command prompt (eg help, set password etc) I get the following error.

ERROR 2003: Can't connect to MySQL server on 'localhost' (10061)

When trying to access the MySQL server via a local web page I am also unable to connect to the database.

I have successfully installed Apache 2.0.35-win32-x8 and PHP.

Appreciate any suggestions for what may be the problem here.

Thanks
David
 
Could you post the actual command that you run and the error message and we will try and help.
e.g.

mysql -h localhost -u root -pmypassword
ERROR 2003: Can't connect to MySQL server on 'localhost' (10061)
 
This is an example of the command I am entering.

mysql -u root password
ERROR 2003: Can't connect to MySQL server on 'localhost' (10061)

THanks for any help
David
 
try mysql -h for help

Permissions/Security is a tuplet of host username and password.

mysql -u root password

means connect using default host [localhost} -u root means as user root you have not specified a password as there is no -p option so it uses the default which is blank and you have specified that you want to connect to a database called password.

mysql -h localhost -u root -p

will connect you to localhost as root and prompt you for a password then connect you to the default database usually test

If you don't want to be prompted for the password you can put it 'immediately' after the -p like this -ppassword - but this really meant for system call within another programme as you dont' really want your password visible at your command prompt.
 
A couple of things to check...

1) The mySql server is actually running (start the service if it is not). I think on Win2K you have to start it manually or set it to automatic and reboot
2) password is correct

HTH, and apologies if you did this already

Jon Daniels
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top