title: Unable to connect to MySQL database
body: <p>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.  </p>
  
  <p>Do I need to do a reinstall?  Can I do a reinstall without losing my data?</p>
  
  <p>Any suggestions?</p>
  
  <p>UPDATE:
  Here's the error message in mysql workbench.
  <img src="https://i.stack.imgur.com/s5hXG.png" alt="enter image description here"></p>
  
  <p>UPDATE2:</p>
  
  <pre><code>Microsoft Windows [Version 6.1.7600]
  Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
  
  C:\Users&gt;net start mysql
  System error 5 has occurred.
  
  Access is denied.
  
  
  C:\Users&gt;
  </code></pre>
  
  <p>UPDATE3:</p>
  
  <p>When I type <code>netstat -a</code> in the cmd window, there doesn't appear to be anything going on on 127.0.0.1:3306.</p>
  
  <p>UPDATE4:</p>
  
  <pre><code>C:\Program Files\MySQL\MySQL Server 5.1\bin&gt;mysql -u root
  ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)
  </code></pre>
  
  <p>UPDATE5:</p>
  
  <pre><code>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                               FALSE
  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
  </code></pre>
  
  <hr>
  
  <pre><code>C:\Program Files\MySQL\MySQL Server 5.1\bin&gt;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.
  </code></pre>