运行 MySQL 或 Windows 上的 MariaDB 服务器的最少文件 - (便携式 MySQL/MariaDB)

Minimum files to run MySQL or MariaDB server on Windows - (Portable MySQL/MariaDB)

我正在寻找 MariaDB 或 MySQL 到 运行 所需的最少文件,而不像便携式服务器那样安装它。我更喜欢 MariaDB 而不是 MySQL。我想把它嵌入到我用 Delphi 编写的软件中。我的软件将能够根据需要启动和停止服务器。我用谷歌搜索但没有成功。

我读过一篇文章 https://rawgit.com/pts/portable-mariadb/master/portable_mariadb.html and http://www.bluecrownsoftware.com/article/271/Installing-MySQL-without-Root-Access-on-Linux,但它是针对 Linux 的,我没有相关经验。

我也看过文章MySql portable version,但是这篇文章提到了MySQL基本版,我找不到它。 如果我有一些成功 运行 连接服务器的配置文件提示,那将是一个额外的价值。

提前致谢。

说到MariaDB,就是2个文件3个目录。

布局是这样的:

  • bin\mysqld.exe
  • share\errmsg.sys # you can take it from share\english in normal installation or ZIP
  • 数据# an empty directory

你可以从

开始
bin\mysqld.exe --console --skip-grant-tables  

(最后一个参数是必不可少的,因为你没有系统表)。

它缺少系统表,如果您需要创建它们,这将是更多的文件。

此工具有帮助 https://mariadb.com/kb/en/mariadb/mysql_install_dbexe/mysqld_install_db.exe 需要放在 mysqld.exe 旁边,然后您可以使用

创建系统表
mysqld_install_db.exe --datadir=path-to-datadir

更新 MariaDB 10.5.3 及更高版本

  • bin\mysqld.exe
  • bin\server.dll
  • bin\mysql_install_db.exe(可选,运行创建数据目录一次,之后可以删除)
  • 数据

与之前版本相比的变化:server.dll 是新的(mysqld.exe 需要),errmsg.sys 不再需要