无法从WAMP登录到MySQL,但可以登录MariaDB

时间:2019-02-13 09:08:47

标签: php mysql phpmyadmin mariadb wamp

我安装了WAMP,并且试图登录phpmyadmin。我无法登录到MySQL,但是我可以登录到MariaDB。 我进行了许多配置更改,但无法登录。

$mariaFirst = ($wampConf['SupportMySQL'] == 'on' && $wampConf['SupportMariaDB'] == 'on' && $wampConf['mariaPortUsed'] == $wampConf['mysqlDefaultPort']) ? true : false;
if($wampConf['SupportMySQL'] == 'on') {
/* Server: localhost [1] */
    $i++;
    if($mariaFirst) $i++;
    $cfg['Servers'][$i]['verbose'] = 'MySQL';
    $cfg['Servers'][$i]['host'] = '127.0.0.1';
    $cfg['Servers'][$i]['port'] = $wampConf['mysqlPortUsed'];
    $cfg['Servers'][$i]['extension'] = 'mysqli';
    $cfg['Servers'][$i]['auth_type'] = 'cookie';
    $cfg['Servers'][$i]['user'] = 'root';
    $cfg['Servers'][$i]['password'] = 'root';

    // Hidden databases in PhpMyAdmin left panel
    //$cfg['Servers'][$i]['hide_db'] = '(information_schema|mysql|performance_schema|sys)';

    // Allow connection without password
    $cfg['Servers'][$i]['AllowNoPassword'] = true;
}
/* Server: localhost [2] */
if($wampConf['SupportMariaDB'] =='on') {
    $i++;
    if($mariaFirst) $i -= 2;
    $cfg['Servers'][$i]['verbose'] = 'MariaDB';
    $cfg['Servers'][$i]['host'] = '127.0.0.1';
    $cfg['Servers'][$i]['port'] = $wampConf['mariaPortUsed'];
    $cfg['Servers'][$i]['extension'] = 'mysqli';
    $cfg['Servers'][$i]['auth_type'] = 'cookie';
    $cfg['Servers'][$i]['user'] = 'root';
    $cfg['Servers'][$i]['password'] = 'root';

    // Hidden databases in PhpMyAdmin left panel
    //$cfg['Servers'][$i]['hide_db'] = '(information_schema|mysql|performance_schema|sys)';
    // Allow connection without password
    $cfg['Servers'][$i]['AllowNoPassword'] = true;
}

// Suppress Warning about pmadb tables
$cfg['PmaNoRelation_DisableWarning'] = true;

// To have PRIMARY & INDEX in table structure export
$cfg['Export']['sql_drop_table'] = true;
$cfg['Export']['sql_if_not_exists'] = true;

我更改了许多参数,但仍然无法登录MySQL,但可以登录MariaDB

1 个答案:

答案 0 :(得分:0)

我找到了解决方案。我让MySQL Workbench在相同的连接设置下运行。因此,我删除了该连接,并能够在WAMP中使用MySQL