screechOwl screechOwl - 1 year ago 85
MySQL Question

Unable to connect to MySQL database

After some virus activity I'm unable to connect to a MySQL db on my laptop. When I look in the task manager (I'm using Windows 7), there's no sign of a MySQL instance. I can't connect thru the prompt window or MySQL workbench.

Do I need to do a reinstall? Can I do a reinstall without losing my data?

Any suggestions?

Here's the error message in mysql workbench.
enter image description here


Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users>net start mysql
System error 5 has occurred.

Access is denied.



When I type
netstat -a
in the cmd window, there doesn't appear to be anything going on on


C:\Program Files\MySQL\MySQL Server 5.1\bin>mysql -u root
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)


Variables (--variable-name=value)
and boolean options {FALSE|TRUE} Value (after reading options)
--------------------------------- -----------------------------
count 0
debug-check FALSE
debug-info FALSE
force FALSE
compress FALSE
character-sets-dir (No default value)
default-character-set (No default value)
host (No default value)
no-beep FALSE
port 3306
relative FALSE
shared-memory-base-name (No default value)
socket (No default value)
sleep 0
ssl-ca (No default value)
ssl-capath (No default value)
ssl-cert (No default value)
ssl-cipher (No default value)
ssl-key (No default value)
ssl-verify-server-cert FALSE
user (No default value)
verbose FALSE
vertical FALSE
connect_timeout 43200
shutdown_timeout 3600

C:\Program Files\MySQL\MySQL Server 5.1\bin>mysqld --console
120207 14:06:00 [Warning] '--default-character-set' is deprecated and will be re
moved in a future release. Please use '--character-set-server' instead.
120207 14:06:00 [Note] Plugin 'FEDERATED' is disabled.
120207 14:06:00 InnoDB: Initializing buffer pool, size = 100.0M
120207 14:06:00 InnoDB: Completed initialization of buffer pool
120207 14:06:00 InnoDB: Operating system error number 5 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory. It may also be you have created a subdirectory
InnoDB: of the same name as a data file.
InnoDB: File name .\ibdata1
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation.

Answer Source

It turned out it was my fault. When I ran HijackThis, one of the lines suggested for deletion was :

O23 - Service: MySQL - Unknown owner - C:\Program.exe (file missing)


Luckily HijackThis keeps backups of changes and I was able to restore this line and MySQL works fine.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download