diff --git a/changelog b/changelog
--- a/changelog
+++ b/changelog
@@ -1,3 +1,8 @@
+v2.3.17
+	* Use a randomly created temp file for test database when running
+	unit tests instead of a hardcoded file under 'dist/'.  Hopefully
+	fixes https://github.com/IreneKnapp/direct-sqlite/issues/60
+
 v2.3.16
 	* Add an Eq instance for SQLError
 
diff --git a/direct-sqlite.cabal b/direct-sqlite.cabal
--- a/direct-sqlite.cabal
+++ b/direct-sqlite.cabal
@@ -1,5 +1,5 @@
 name: direct-sqlite
-version: 2.3.16
+version: 2.3.17
 build-type: Simple
 license: BSD3
 license-file: LICENSE
@@ -105,4 +105,5 @@
                , directory
                , HUnit
                , direct-sqlite
+               , temporary
                , text
diff --git a/test/Main.hs b/test/Main.hs
--- a/test/Main.hs
+++ b/test/Main.hs
@@ -14,6 +14,7 @@
 import System.Exit          (exitFailure)
 import System.IO
 import System.IO.Error      (isDoesNotExistError, isUserError)
+import System.IO.Temp       (withTempFile)
 import System.Timeout       (timeout)
 import Test.HUnit
 
@@ -875,16 +876,13 @@
           return ()
 
 
-sharedDBPath :: Text
-sharedDBPath = "dist/test/direct-sqlite-test-database.db"
-
-withTestEnv :: (TestEnv -> IO a) -> IO a
-withTestEnv cb =
+withTestEnv :: String -> (TestEnv -> IO a) -> IO a
+withTestEnv tempDbName cb =
     withConn $ \conn ->
         cb TestEnv
             { conn           = conn
             , withConn       = withConn
-            , withConnShared = withConnPath sharedDBPath
+            , withConnShared = withConnPath (T.pack tempDbName)
             }
   where
     withConn = withConnPath ":memory:"
@@ -898,28 +896,20 @@
       close conn
       return r
 
-runTestGroup :: [TestEnv -> Test] -> IO Bool
-runTestGroup tests = do
+runTestGroup :: String -> [TestEnv -> Test] -> IO Bool
+runTestGroup tempDbName tests = do
   Counts{cases, tried, errors, failures} <-
-    withTestEnv $ \env -> runTestTT $ TestList $ map ($ env) tests
+    withTestEnv tempDbName $ \env -> runTestTT $ TestList $ map ($ env) tests
   return (cases == tried && errors == 0 && failures == 0)
 
 main :: IO ()
 main = do
   mapM_ (`hSetBuffering` LineBuffering) [stdout, stderr]
-
-  T.putStrLn $ "Creating " `T.append` sharedDBPath
-  handleJust (\e -> if isDoesNotExistError e
-                       then Just ()
-                       else Nothing)
-             (\_ -> return ())
-             (removeFile $ T.unpack sharedDBPath)
-  open sharedDBPath >>= close
-
-  ok <- runTestGroup regressionTests
-  when (not ok) exitFailure
-
-  -- Signal failure if feature tests fail.  I'd rather print a noisy warning
-  -- instead, but cabal redirects test output to log files by default.
-  ok <- runTestGroup featureTests
-  when (not ok) exitFailure
+  withTempFile "." "direct-sqlite-test-database" $ \tempDbName _hFile -> do
+    open (T.pack tempDbName) >>= close
+    ok <- runTestGroup tempDbName regressionTests
+    when (not ok) exitFailure
+    -- Signal failure if feature tests fail.  I'd rather print a noisy warning
+    -- instead, but cabal redirects test output to log files by default.
+    ok <- runTestGroup tempDbName featureTests
+    when (not ok) exitFailure
