mysql - Wamp-无法使用MySQL选项连接到PhpMyAdmin

标签 mysql mariadb wamp

由于我安装了MySQL工作台并为项目使用了其他端口(3307),因此无法使用MySQL选项(仅使用MariaDB选项和password = password)连接到PhpMyAdmin。

当我在MySQL Workbench上使用查询更改密码时:

ALTER USER 'user-name'@'localhost' IDENTIFIED BY 'NEW_USER_PASSWORD';


从那时起,我无法使用root且没有密码连接到PhpMyAdmin(使用WAMP),因此我必须使用其他项目。

我真的是WAMP / MySQL等的初学者,但是当我更改密码和端口时,我感觉是偶然切换到了MariaDB。

我的错误看起来像:

enter image description here

我在Internet上找不到任何解决方案。

我当前的config.inc.php:

<?php

/* Servers configuration */
$i = 0;
/* The 'cookie' auth_type uses AES algorithm to encrypt the password. If
 * at least one server configuration uses 'cookie' auth_type, enter here a
 * pass phrase that will be used by AES. The minimum length is 32 characters
 * The maximum length seems to be 46 characters. */
$cfg['blowfish_secret'] = 'h]C+{nqW$omNoTIkCwC$%z-LTcy%p6_j';

//Checking Active DBMS Servers
$wampConf = @parse_ini_file('../../wampmanager.conf');
//Check if MySQL and MariaDB with MariaDB on default port
$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:3307';
    $cfg['Servers'][$i]['port'] = $wampConf['mysqlPortUsed'];
    $cfg['Servers'][$i]['extension'] = 'mysqli';
    $cfg['Servers'][$i]['auth_type'] = 'cookie';
    $cfg['Servers'][$i]['user'] = '';
    $cfg['Servers'][$i]['password'] = '';

    // 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'] = '';
    $cfg['Servers'][$i]['password'] = '';

    // 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;

$cfg['MySQLManualBase'] = 'http://dev.mysql.com/doc/refman/5.7/en/';
/* End of servers configuration */

?>

最佳答案

您可以执行以下检查:


确保WAMPP MySQL服务器正在运行


如果一切正常,请尝试对phpmyadmin配置进行以下更改:
phpmyadmin配置位于:C:\ wampp \ phpMyAdmin \ config.inc.php

尝试进行以下更改
1。更改以下行:


 $cfg['Servers'][$i]['auth_type'] = 'config';





 $cfg['Servers'][$i]['auth_type'] = 'cookie';  


2。如果您更改了MySQL PORT,请考虑更改以下行:

$cfg['Servers'][$i]['host'] = '127.0.0.1'; 


进入

$cfg['Servers'][$i]['host'] = '127.0.0.1: 3307'; 

关于mysql - Wamp-无法使用MySQL选项连接到PhpMyAdmin,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59137910/

相关文章:

mysql - 从 InnoDB 表中删除并重用第一个自动增量 ID

bash - 启动容器进程导致 "exec:\"bash\": executable file not found in $PATH": unknown

mysql - 如何在 Windows 上备份 MySQL 数据库?

mysql - 在 WAMP 上运行的 PHPMyAdmin 仅将 db 导出到 1MB

mysql - 如何使用 mysql 找出具有所需技能的员工

mysql - vb.net 在 MySQL 数据库中写入和读取多行文本

mysql - 1292 截断了不正确的 INTEGER 值

mysql - 无法连接到 '127.0.0.1' 上的 MySQL 服务器

php - 将 NULL 值插入到类型为 char(2) 的数据库字段中

php_oci8 未在 wamp 服务器 2.0 上加载?