【问题标题】:Using wamp server how can I have mysql directory on another location?使用 wamp 服务器如何在另一个位置拥有 mysql 目录?
【发布时间】:2015-09-01 14:14:54
【问题描述】:

我在我的 Windows 上安装了 wamp,我需要整个 wamp mysql-server 目录文件(不仅是在类似问题中询问的数据库文件)移动到另一个位置 但是移动后当我尝试更改 wamp 设置文件和配置文件时,它无法运行 mysql。
我也尝试在移动其位置后重新安装 wamp wampmysqld 服务,但仍然无法运行 mysql 服务。有人知道我该怎么做吗?

【问题讨论】:

  • 您是否要让 2 个不同的 MYSQL Server 实例同时查看相同的数据库?
  • @RiggsFolly 不,我想使用相同的 mysql 实例,但不在 wamps 预定义的子文件夹中。我想把它放在其他目录中。
  • @RiggsFolly 现在我更新了关于您的评论的问题,以便更清楚。谢谢你提到的一点。
  • 为什么需要 MySQL 从这个 developing 文件夹运行。它是一个可以在任何地方运行的服务器。
  • @RiggsFolly 只是暂时我需要设置 wamp 设置以从外部位置加载其 mysql 实例。我知道这不是常规的,但它可以帮助我更快地在我的应用程序上做事。

标签: mysql wamp wampserver


【解决方案1】:

根据我们的讨论,您说您有一个使用 MYSQL 数据库服务器实例的应用程序,该实例将随您的应用程序一起安装。此 MYSQL 实例使用非标准端口号,因此如果有人已经在他们的系统上安装了 MYSQL 实例或在安装您的应用程序后安装了一个,它不会受到干扰。

在这种情况下,为了允许您使用 WAMPServers phpMyAdmin 来维护和操作您的数据库,但不必以任何主要方式更改 WAMPServer 配置,我建议您查看 phpMyAdmin 的配置。可以通过修改\wamp\apps\phpmyadmin{version_number}\config.inc.php 添加另一个服务器实例,即您的应用程序实例,让 phpMyAdmin 查看多个 MySQL 服务器实例。

所以假设您的应用程序 MYSQL 实例正在侦听端口 8888

改变:

<?php

/*
 * Servers configuration
 */
$i = 0;

/*
 * First server
 */
$i++;
/* Authentication type */
$cfg['Servers'][$i]['verbose'] = 'mysql wampserver';
//$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
/* Server parameters */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;

<?php

/*
 * Servers configuration
 */
$i = 0;

/*
 * First server
 */
$i++;
/* Authentication type */
$cfg['Servers'][$i]['verbose'] = 'mysql wampserver';
//$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
/* Server parameters */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;

/*
 * Second server, My Apps instance of MySQL
 */
$i++;
/* Authentication type */
$cfg['Servers'][$i]['verbose'] = 'mysql for my APP';
//$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
/* Server parameters */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['port'] = '9999';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = false;

现在,当您使用 MYSQL 实例的下拉列表和用户名和密码字段来接受您从下拉列表中选择的数据库实例的帐户和密码设置运行 phpMyAdmin 时,这应该会抛出一个质询页面

【讨论】:

  • 这可能无法直接回答我的问题,但在我正在寻找解决方案时完全解决了我的问题。
猜你喜欢
  • 2014-05-10
  • 2015-10-31
  • 2012-05-13
  • 2018-03-24
  • 2013-09-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-11-02
相关资源
最近更新 更多