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

Hi all,

I'm trying to use MySQL to log data from Snort, but I can't get MySQL to work. When I enter mysql.exe, I receive the following error:


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

Here's my my.ini:
[mysqld]
basedir=C:\EagleX\MySQL
bind-address=127.0.0.1
datadir=C:\EagleX\MySQL\data
skip-innodb
#language=C:\EagleX\MySQL\share\your language directory
#slow query log#=
#tmpdir#=
port=7788
#set-variable=key_buffer=16M
[WinMySQLadmin]
Server=C:/EagleX/MySql/bin/mysqld-nt.exe
user=*****
password*******
QueryInterval=10

Any suggestions would be greatly appreciated!!!

LVL 2
meade470Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

lokusCommented:
First, make sure your mysql server is running, you can confirm it by running
> mysqld --console
It should tell you a server is already running on port: 7788, you have set to run mysql server on port 7788.
If it is not running, this will start the mysqld server.

In order to connect to mysql server uisng mysql, you need to specify the port number because your mysqls server is running on port 7788 as specified in your config file, not the default port 3306
Try:
> mysql -P7788
to specify the port number 7788

Note that mysql.exe is a client to connect to MySQL server, it is not the database itself.

0
UmeshMySQL Principle Technical Support EngineerCommented:
Hi,

well u must check whether or not ur mysql server is running..also your path separator must be / or // and not \..so do accordingly in my.ini file..



basedir=C:/EagleX/MySQL
bind-address=127.0.0.1
datadir=C:/EagleX/MySQL/data
skip-innodb
#language=C:/EagleX/MySQL/share/your language directory
#slow query log#=
#tmpdir#=
port=7788
#set-variable=key_buffer=16M
[WinMySQLadmin]
Server=C:/EagleX/MySql/bin/mysqld-nt.exe
user=*****
password=*******
QueryInterval=10

0
Duane LawrenceCommented:
I am just guessing that this is a brand new database and a new user, here are some instructions on getting MySQL running for the first time.  If that is not the case, then you definatly have a permisions problem at the least, this will also solve the permissions problem.

Duane

#1.
# I downloaded and installed MySQL just fine, Using it is proving
# to be difficult. It should be noted that the "HELP" is in the
# manuals and can be found on the following path:
# file:///C:/mysql/Docs/manual_toc.html

#2. Run c:\mysql\bin\winmysqladmin.exe, it will set up a user
# and a password.
# These are entered into the my.ini file by winmysqladmin.exe.
# You can look them up if you forget. For this purpose,
# the user name is John and the password is foo.

#3.
# IMPORTANT NOTE: THE '#' IS THE BEGINNING OF COMMENTS.
#using the mysql.exe shell from a command line.
#The second mysql specifies the database your connecting to.
mysql mysql -h localhost -u root -p
password
#IMPORTANT: Before I did the above command, when I did a
#'show databases;' the only one I got was the test database.


#4. now grant all to user on the PC your on.
#where testpc is the name of the computer that MySQL is on
#and where xxx is the password.
grant all privileges on *.* to john@testpc identified by 'foo' with grant option;


#5. finally create the database.
create database foo;


#FOOTNOTE:
#CANT RUN MYSQL.EXE
#Add "c:\mysql\bin" to the "path" in system variables.
# That is assuming you installed MySQL to the "c:\mysql"
# How to get there: Open the control panel in Windows,
# open the system, goto the advanced tab, click on the
# "enviornment variables" button, edit the path and add
# the above.
# This can be found on http://www.duanelawrence.com


------------------------------------------------------------------------------
# Thing to do after you can create a database.

use mysql;

show columns from user;

# see the below website for ANSI SQL lesson.
# http://www.samspublishing.com/articles/article.asp?p=30875&seqNum=4

------------------------------------------------------------------------------
# IMPORTANT SAFETY TIP: CHANGE THE ROOT PASSWORD FROM ITS DEFAULT OF BLANK!
mysqladmin -u root -h testbox password 'new-password'


duane
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

meade470Author Commented:
Great info, guys--but now I'm really confused.  This is what I know.

When I type this at the command line:
mysql mysql -h localhost
I receive a list of options/switches.

When I type this at the command line:
mysqld-nt --console
It tells me that its: "Ready for connections."

Why I search my entire harddrive, I can't find a "my.cnf" file.  Am I supposed to have one?

Please help!




0
lokusCommented:

When I type this at the command line:
mysqld-nt --console
It tells me that its: "Ready for connections."

If that is what you got as above, your mysql server was NOT started in the first place, that is why the command started it for you, if your mysql server had already started, the command will say so and will not start another server process.
Please read http://dev.mysql.com/doc/mysql/en/Windows_installation.html
to familiar yourself with the complete installation steps.

As for the file my.cnf, it is equivalend to your my.ini file.
0
meade470Author Commented:
I think I was having a right's issue.  I reinstalled MySQL and everything is fine.  Thanks for your help.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.