diff --git a/CHANGELOG b/CHANGELOG
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,8 @@
+0.8.0
+-----
+* Better handling of ghc databases, by ensuring that only the global database
+  and the cabal sandbox database are available.
+
 0.7.10
 ------
 * Raise upper bounds of dependencies
diff --git a/cabal-cargs.cabal b/cabal-cargs.cabal
--- a/cabal-cargs.cabal
+++ b/cabal-cargs.cabal
@@ -1,5 +1,5 @@
 name: cabal-cargs
-version: 0.7.12
+version: 0.8.0
 cabal-version: >=1.9.2
 build-type: Simple
 license: BSD3
diff --git a/lib/CabalCargs/Format.hs b/lib/CabalCargs/Format.hs
--- a/lib/CabalCargs/Format.hs
+++ b/lib/CabalCargs/Format.hs
@@ -22,7 +22,9 @@
                           , formatIncludeDirs $ includeDirs cargs
                           , formatIncludes $ includes cargs
                           , formatBuildDepends $ buildDepends cargs
-                          , maybe [] (\db -> ["-package-db=" ++ db]) (packageDB cargs)
+                          , maybe []
+                                  (\db -> ["-clear-package-db", "-global-package-db", "-package-db=" ++ db])
+                                  (packageDB cargs)
                           , formatHsSourceDirs $ autogenHsSourceDirs cargs
                           , formatIncludeDirs $ autogenIncludeDirs cargs
                           , formatIncludes $ autogenIncludes cargs
