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?
 
Duane LawrenceConnect With a Mentor Commented:
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
 
lokusConnect With a Mentor Commented:
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
 
UmeshConnect With a Mentor MySQL 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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
All Courses

From novice to tech pro — start learning today.