【发布时间】:2016-09-03 12:50:07
【问题描述】:
每次我尝试访问 phpMyAdmin 时,它都会弹出一个对话框,需要用户名和密码。我尝试使用root作为用户名并将密码留空,它不起作用。但是,当我尝试使用 admin 作为用户名并将密码留空时,它可以工作。但是还有一个问题,说明admin没有权限创建数据库。
那么我怎样才能以 root 身份访问 phpmyadmin?或者当我以管理员身份登录时如何提升权限?
以下是config.inc.php:
$cfg['Servers'][$i]['host'] = '127.0.0.1'; // MySQL hostname or IP address
$cfg['Servers'][$i]['port'] = ''; // MySQL port - leave blank for default port
$cfg['Servers'][$i]['socket'] = ''; // Path to the socket - leave blank for default socket
$cfg['Servers'][$i]['connect_type'] = 'tcp'; // How to connect to MySQL server ('tcp' or 'socket')
$cfg['Servers'][$i]['extension'] = 'mysql'; // The php MySQL extension to use ('mysql' or 'mysqli')
$cfg['Servers'][$i]['compress'] = FALSE; // Use compressed protocol for the MySQL connection
// (requires PHP >= 4.3.0)
$cfg['Servers'][$i]['hide_db'] = 'information_schema';
$cfg['Servers'][$i]['controluser'] = ''; // MySQL control user settings
// (this user must have read-only
$cfg['Servers'][$i]['controlpass'] = ''; // access to the "mysql/user"
// and "mysql/db" tables).
// The controluser is also
// used for all relational
// features (pmadb)
$cfg['Servers'][$i]['auth_type'] = 'http'; // Authentication method (config, http or cookie based)?
$cfg['Servers'][$i]['user'] = 'root'; // MySQL user
$cfg['Servers'][$i]['password'] = ''; // MySQL password (only needed
// with 'config' auth_type)
$cfg['Servers'][$i]['only_db'] = ''; // If set to a db-name, only
// this db is displayed in left frame
// It may also be an array of db-names, where sorting order is relevant.
$cfg['Servers'][$i]['verbose'] = ''; // Verbose name for this host - leave blank to show the hostname
【问题讨论】:
-
127.0.0.1 和 localhost 对于 mysql.User 表是不同的。所以尝试使用 localhost 而不是 127.0.0.1 作为主机
标签: mysql phpmyadmin