连接到 phpmyadmin [重复]
Posted
技术标签:
【中文标题】连接到 phpmyadmin [重复]【英文标题】:Connecting to phpmyadmin [duplicate] 【发布时间】:2014-09-28 18:02:43 【问题描述】:警告:mysql_connect() [function.mysql-connect]:用户'root'@'localhost'的访问被拒绝(使用密码:否)
$dbh = mysql_connect('localhost', 'root','');
/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPasswordRoot'] = TRUE;
$cfg['Servers'][$i]['AllowNoPassword'] = TRUE;
$cfg['Lang'] = '';
/* Bind to the localhost ipv4 address and tcp */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = '';
/* Advanced phpMyAdmin features */
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
$cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
$cfg['Servers'][$i]['relation'] = 'pma_relation';
$cfg['Servers'][$i]['table_info'] = 'pma_table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma_column_info';
$cfg['Servers'][$i]['history'] = 'pma_history';
$cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';
$cfg['Servers'][$i]['tracking'] = 'pma_tracking';
$cfg['Servers'][$i]['userconfig'] = 'pma_userconfig';
$cfg['Servers'][$i]['recent'] = 'pma_recent';
$cfg['Servers'][$i]['table_uiprefs'] = 'pma_table_uiprefs';
/*
大家好。当我尝试连接到 phpmyadmin 上的数据库时出现错误。我不知道为什么它拒绝访问。有人知道为什么会这样吗?
【问题讨论】:
似乎很不言自明。你检查过没有密码的root用户存在吗? @scrowler 我该怎么做(我是新手) 【参考方案1】:转到 phpmyadmmin
类型
http://localhost/phpmyadmin
页面顶部的第 4 个选项卡是用户。点击它,您将看到一个简单的表格,其中包含 db server 上所有用户的名称和权限
【讨论】:
以上是关于连接到 phpmyadmin [重复]的主要内容,如果未能解决你的问题,请参考以下文章