使用wamp服务器我怎么能在另一个位置有mysql目录?

时间:2015-09-01 14:14:55

标签: mysql wamp wampserver

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

1 个答案:

答案 0 :(得分:1)

根据我们的讨论,您说您有一个应用程序,它使用将随您的应用程序一起安装的MYSQL数据库服务器实例。这个MYSQL实例使用非标准端口号,这样如果任何人已经在他们的sysem上安装了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以及一个USername和Password字段来接受为你从下拉列表中选择的数据库实例设置的帐户和密码时,现在应该抛出一个挑战页面