 --- a/scripts/CMakeLists.txt
 +++ b/scripts/CMakeLists.txt
-@@ -175,23 +175,13 @@
+@@ -168,25 +168,14 @@
  # i.e. makes access relative the current directory. This matches
  # the documentation, so better not change this.
- 
+
 -IF(INSTALL_LAYOUT MATCHES "STANDALONE")
 -  SET(prefix ".")
 -  SET(bindir ${prefix}/${INSTALL_BINDIR})

+SET(scriptdir ${prefix}/${INSTALL_BINDIR})
+SET(libexecdir ${prefix}/${INSTALL_SBINDIR})
+SET(pkgdatadir ${prefix}/${INSTALL_MYSQLSHAREDIR})
+SET(localstatedir ${MYSQL_DATADIR})
 
 IF(UNIX)
 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_install_db.sh

-  SET(scriptdir ${prefix}/${INSTALL_BINDIR})
-  SET(libexecdir ${prefix}/${INSTALL_SBINDIR})
-  SET(pkgdatadir ${prefix}/${INSTALL_MYSQLSHAREDIR})
-  SET(pkgplugindir ${prefix}/${INSTALL_PLUGINDIR})
-  SET(localstatedir ${prefix}/data)
-ELSE()
-  SET(prefix "${CMAKE_INSTALL_PREFIX}")
