diff --git a/ChangeLog.md b/ChangeLog.md
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,5 +1,11 @@
 # Revision history for mysql-haskell
 
+## 0.5.0.0 -- 2016-8-22
+
+* Export exception types.
+* Fix a regression cause password authentication failed, add tests.
+* Fix a reading order bug cause 'prepareStmt/prepareStmtDetail' failed.
+
 ## 0.4.0.0 -- 2016-8-22
 
 * Enable TLS support via `tls` package, add benchmarks.
diff --git a/Database/MySQL/Base.hs b/Database/MySQL/Base.hs
--- a/Database/MySQL/Base.hs
+++ b/Database/MySQL/Base.hs
@@ -52,6 +52,13 @@
     , renderParams
     , command
     , Stream.skipToEof
+      -- * Exceptions
+    , NetworkException(..)
+    , UnconsumedResultSet(..)
+    , ERRException(..)
+    , UnexpectedPacket(..)
+    , DecodePacketException(..)
+    , WrongParamsCount(..)
       -- * MySQL protocol
     , module  Database.MySQL.Protocol.Auth
     , module  Database.MySQL.Protocol.Command
diff --git a/Database/MySQL/Protocol/Auth.hs b/Database/MySQL/Protocol/Auth.hs
--- a/Database/MySQL/Protocol/Auth.hs
+++ b/Database/MySQL/Protocol/Auth.hs
@@ -100,7 +100,10 @@
     skip 10 -- 10 * 0x00
     salt2 <- if (cap .&. CLIENT_SECURE_CONNECTION) == 0
         then pure B.empty
-        else let len = max 13 (authPluginLen - 8) in getByteString (fromIntegral len)
+        else getByteStringNul   -- This is different with the MySQL document here
+                                -- The doc said we should expect a MAX(13, length of auth-plugin-data - 8)
+                                -- length bytes, but doing so stop us from login
+
     authPlugin <- if (cap .&. CLIENT_PLUGIN_AUTH) == 0
         then pure B.empty
         else getByteStringNul
diff --git a/mysql-haskell.cabal b/mysql-haskell.cabal
--- a/mysql-haskell.cabal
+++ b/mysql-haskell.cabal
@@ -1,5 +1,5 @@
 name:                mysql-haskell
-version:             0.4.1.0
+version:             0.5.0.0
 synopsis:            pure haskell MySQL driver
 description:         pure haskell MySQL driver
 license:             BSD3
diff --git a/test/Main.hs b/test/Main.hs
--- a/test/Main.hs
+++ b/test/Main.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE ScopedTypeVariables #-}
+
 module Main where
 
 import qualified BinaryRow
@@ -5,7 +7,7 @@
 import qualified BinLog
 import qualified BinLogNew
 import           Control.Concurrent    (forkIO, threadDelay)
-import           Control.Exception     (bracket)
+import           Control.Exception     (bracket, catch)
 import           Control.Monad
 import qualified Data.ByteString       as B
 import           Database.MySQL.Base
@@ -118,6 +120,24 @@
 
     close c
 
+    (greet, c) <- connectDetail defaultConnectInfo {ciUser = "testMySQLHaskell", ciDatabase = "testMySQLHaskell"}
+    execute_ c "SET PASSWORD = PASSWORD('123456abcdefg???')"
+    close c
+
+    let loginFailMsg = "ERRException (ERR {errCode = 1045, errState = \"28000\", \
+            \errMsg = \"Access denied for user 'testMySQLHaskell'@'localhost' (using password: YES)\"})"
+
+    (greet, c) <- connectDetail
+        defaultConnectInfo {ciUser = "testMySQLHaskell", ciDatabase = "testMySQLHaskell", ciPassword = "123456abcdefg???"}
+    execute_ c "SET PASSWORD = PASSWORD('')"
+    close c
+
+    catch
+        (void $ connectDetail
+                    defaultConnectInfo
+                        {ciUser = "testMySQLHaskell", ciDatabase = "testMySQLHaskell", ciPassword = "wrongPassWord"})
+        (\ (e :: ERRException) -> assertEqual "wrong password should fail to login" (show e) loginFailMsg)
+
   where
     resetTestTable c = do
             execute_ c  "DELETE FROM test WHERE __id=0"
@@ -162,3 +182,5 @@
                         \NULL,\
                         \NULL\
                         \)"
+
+
