title: ERROR 2027 (HY000): Malformed packet - during login
body: <pre><code>C:\Program Files\MySQL\MySQL Server 5.7\bin&gt;mysql -u root -p
  Enter password:
  ERROR 2027 (HY000): Malformed packet
  </code></pre>
  
  <p>I have 2 MySQL DBs version on my server 4.0 and 5.7. My apps can connect to both MySQL DBs without problem but when I try to login to the MySQL Command-Line Tool it is showing error as shown below. I also noticed even when I stopped the MySQL 5.7 service it is showing the same error but if I stopped the MYSQL4.0 service, it is showing:</p>
  
  <p><code>ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)</code></p>
  
  <p>Based on the some of the replies from similar topics, the malformed packet is because of the old password hashed issue but what are the things I need to do to change the password? Or my issue is not related with password?</p>
  
  <p>FYI, I am using Windows Server 2012 R2. Mysql 5.7.21 and Mysql 4.0.17</p>