MySql 便携版
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1851174/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
MySql portable version
提问by Leo
anyone know a portable version of mysql?
有人知道mysql的便携版本吗?
I know xampp but it comes with PHP and Apache together
我知道 xampp 但它与 PHP 和 Apache 一起提供
anyone know how to isolate the mysql?
有人知道如何隔离mysql吗?
回答by Synetech
You can download the MySQL Essentials version and make a few small changes to directories in the my.ini
file to use relative paths instead of absolute paths. Then you can run the server directly without having to install or use a Windows service.
您可以下载 MySQL Essentials 版本并对my.ini
文件中的目录进行一些小的更改以使用相对路径而不是绝对路径。然后您可以直接运行服务器,而无需安装或使用 Windows 服务。
Download a MySQL
.zip
file (instead of an.msi
, though you could get the.msi
and use 7Zip or Orca to extract the files from it).Extract the files. At a minimum you need the
bin
andshare
directories (actually, inbin
, you really only needmysqld.exe
as the absolute minimum to run a server).Edit
my.ini
to change thebasedir
anddatadir
paths to something relative. For example:basedir=".." datadir="/MySQLdb"
If you do not have an existing database, then create one:
mysqld --bootstrap
Run the server (you may need to use the
--skip-grant-tables
switch to get it running until you have set up your MySQL user):mysqld
To avoid the server being run in the current command-prompt, you can use the following to have it run in its own console which should disappear once it is running:
start mysqld
If you get errors, delete the log files (e.g.,
logs\ib_logfile*
) and run it again.
下载一个MySQL
.zip
文件(而不是一个.msi
,但你可以得到.msi
和使用7Zip的逆戟鲸,以从中提取的文件)。提取文件。您至少需要
bin
和share
目录(实际上,在 中bin
,您实际上只需要mysqld.exe
作为运行服务器的绝对最小值)。编辑
my.ini
以将basedir
和datadir
路径更改为相关内容。例如:basedir=".." datadir="/MySQLdb"
如果您没有现有数据库,请创建一个:
mysqld --bootstrap
运行服务器(
--skip-grant-tables
在设置 MySQL 用户之前,您可能需要使用开关使其运行):mysqld
为避免服务器在当前命令提示符下运行,您可以使用以下命令让它在自己的控制台中运行,一旦运行,该控制台就会消失:
start mysqld
如果出现错误,请删除日志文件(例如
logs\ib_logfile*
)并再次运行。
回答by yoda
I think not, without counting on XAMPP. You don't have to use PHP or Apache anyway, just run the mysql from the .exe's
我认为不会,不指望 XAMPP。无论如何,您不必使用 PHP 或 Apache,只需从 .exe 运行 mysql