Hopefully someone can help me, for I have queried the web with no success or concrete answer to this error. I’m using Windows and Xampp. Here is the error I am getting after I have recently imported the database into phpmyadmin…
希望有人可以帮助我,因为我已经查询了网络,没有成功或对此错误的具体答案。我正在使用Windows和Xampp。这是我最近将数据库导入phpmyadmin后得到的错误...
#1142 - SELECT command denied to user ''@'localhost' for table 'pma_table_uiprefs'
After I import the database, everything is fine in phpmyadmin until I log out and then log back in, this is where the problem lies. When I click on any of the tables from the imported database, I get the following errors…
导入数据库之后,在phpmyadmin中一切正常,直到我退出然后重新登录,这就是问题所在。当我点击导入数据库中的任何表时,我收到以下错误...
SELECT 'prefs'
FROM 'phpmyadmin'.'pma_table_uiprefs'
WEHRE 'username' = 'root'
AND 'db_name' = 'afdb'
AND 'table_name' = 'role'
#1142 - SELECT command denied to user ''@'localhost' for table 'pma_table_uiprefs'
Thank you again for taking time to read my post and hopefully someone can help me with this error.
再次感谢您花时间阅读我的帖子,希望有人可以帮我解决这个错误。
10 个解决方案
#1
30
The pma_table_uiprefs table contains user preferences. In phpMyAdmin's config.inc.php, access to this table (and other tables in the configuration storage) is done via the control user. In your case, the controluser parameter is empty, therefore the query fails.
pma_table_uiprefs表包含用户首选项。在phpMyAdmin的config.inc.php中,通过控制用户访问此表(以及配置存储中的其他表)。在您的情况下,controluser参数为空,因此查询失败。
For a short-term fix, put the "//" characters in config.inc.php at the start of this line:
对于短期修复,请将config.inc.php中的“//”字符放在此行的开头:
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
then log out and log back in.
然后注销并重新登录。
For a long-term fix, correctly set up the configuration storage, see http://docs.phpmyadmin.net/en/latest/setup.html#phpmyadmin-configuration-storage
要进行长期修复,请正确设置配置存储,请参阅http://docs.phpmyadmin.net/en/latest/setup.html#phpmyadmin-configuration-storage
#2
7
There is another way of solving this.
还有另一种解决方法。
Following the instructions in http://docs.phpmyadmin.net/en/latest/setup.html#phpmyadmin-configuration-storage:
按照http://docs.phpmyadmin.net/en/latest/setup.html#phpmyadmin-configuration-storage中的说明操作:
1.- I opned xampp\phpMyAdmin\config.inc.php file and found the following lines:
1.-我选择了xampp \ phpMyAdmin \ config.inc.php文件并找到以下行:
/* User for advanced features */\\
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = '';
2.- Then I observed in phpmyadmin the following tables:
2.-然后我在phpmyadmin中观察到以下表格:
DATABASE: phpmyadmin
数据库:phpmyadmin
TABLES: pma_bookmark pma_column_info pma_designer_coords pma_history pma_pdf_pages pma_recent pma_relation pma_table_coords pma_table_info pma_table_uiprefs pma_tracking pma_userconfig
表格:pma_bookmark pma_column_info pma_designer_coords pma_history pma_pdf_pages pma_recent pma_relation pma_table_coords pma_table_info pma_table_uiprefs pma_tracking pma_userconfig
3.- I run this sql statement:
3.-我运行这个sql语句:
GRANT SELECT , INSERT , UPDATE , DELETE ON phpmyadmin.* TO `pma`@`localhost` IDENTIFIED BY ''
And it worked.
它奏效了。
#3
4
On ubuntu, try dpkg-reconfigure phpmyadmin and recreate the phpmyadmin database. I installed using ansible and this was not done.
在ubuntu上,尝试dpkg-reconfigure phpmyadmin并重新创建phpmyadmin数据库。我使用ansible安装,但没有完成。
#4
3
-
Open the config.inc.php file from C:\xampp\phpmyadmin
从C:\ xampp \ phpmyadmin打开config.inc.php文件
-
Put the "//" characters in config.inc.php at the start of below line:
将config.inc.php中的“//”字符放在下面一行的开头:
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
$ cfg ['Servers'] [$ i] ['pmadb'] ='phpmyadmin';
Example: // $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
示例:// $ cfg ['Servers'] [$ i] ['pmadb'] ='phpmyadmin';
-
Reload your phpmyadmin at localhost.
在localhost重新加载您的phpmyadmin。
#5
2
I stumble upon this issue and I solved it just by logging out of phpMyAdmin and in again.
我偶然发现了这个问题,我只是通过注销phpMyAdmin再次解决了这个问题。
EXPLANATION
Take a look at the error message query:
看一下错误消息查询:
SELECT command denied to user ''@'localhost' for table 'pma_table_uiprefs'
This happens due to MySQL denying access to user "" (blank) at server localhost
. The default setting is to block all requests from anonymous users.
这是因为MySQL拒绝在服务器localhost访问用户“”(空白)。默认设置是阻止来自匿名用户的所有请求。
By logging out we force phpMyAdmin to "forget" the current user and let us input the login credentials for the MySQL server.
通过注销,我们强制phpMyAdmin“忘记”当前用户,让我们输入MySQL服务器的登录凭据。
#6
1
If you use XAMPP Path ( $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin'; ) C:\xampp\phpmyadmin\config.inc.php (Probably XAMPP1.8 at Line Number 34)
如果你使用XAMPP路径($ cfg ['Servers'] [$ i] ['pmadb'] ='phpmyadmin';)C:\ xampp \ phpmyadmin \ config.inc.php(可能是第34行的XAMPP1.8)
Another Solution: I face same type problem "#1142 - SELECT command denied to user ''@'localhost' for table 'pma_recent'"
另一个解决方案:我面临同样类型的问题“#1142 - 用户''@ localhost'拒绝SELECT表命令'pma_recent'”
- open phpmyadmin==>setting==>Navigation frame==> Recently used tables==>0(set the value 0) ==> Save
- 打开phpmyadmin ==>设置==>导航框架==>最近使用的表格==> 0(设置值0)==>保存
#7
0
I know this may sound absurd, but I solved a similar issue by creating the database as "phpMyAdmin" not "phpmyadmin" (note case) - perhaps there is something about case-sensitivity under Windows?
我知道这听起来很荒谬,但我通过创建数据库“phpMyAdmin”而不是“phpmyadmin”(注意案例)解决了类似的问题 - 也许在Windows下有一些关于区分大小写的东西?
#8
0
Commenting out this line worked for me: $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin'; But I found several config.inc.php files on my computer because I had a couple installations of MySQL and php haha. I changed it by finding the one under Xampp by just clicking on the config button under Apache for the Xampp control panel then commenting out the line. //
评论出这条线对我有用:$ cfg ['Servers'] [$ i] ['pmadb'] ='phpmyadmin';但我在我的计算机上发现了几个config.inc.php文件,因为我有几个安装的MySQL和php哈哈。我通过在Xampp控制面板上单击Apache下的配置按钮然后注释掉该行来找到Xampp下的那个。 //
#9
0
One way to resolve this is to login to your root user in phpmyadmin, go to the users tab, find and select the specific user that can't access the select and other queries . Then tick the all checkboxes and just click go. Now that user can select, update and whatever they want.
解决此问题的一种方法是在phpmyadmin中登录root用户,转到“用户”选项卡,查找并选择无法访问select和其他查询的特定用户。然后勾选所有复选框,然后单击go。现在用户可以选择,更新和他们想要的任何东西。
#10
0
The phpMyAdmin configuration directory is not fully configured, some of the extensions are disabled. Find out why. http://localhost:8080/phpmyadmin/doc/html/setup.html#linked-tables
phpMyAdmin配置目录未完全配置,某些扩展已禁用。找出为什么。 HTTP://本地主机:8080 / phpMyAdmin的/ DOC / HTML / setup.html#链接表
#1
30
The pma_table_uiprefs table contains user preferences. In phpMyAdmin's config.inc.php, access to this table (and other tables in the configuration storage) is done via the control user. In your case, the controluser parameter is empty, therefore the query fails.
pma_table_uiprefs表包含用户首选项。在phpMyAdmin的config.inc.php中,通过控制用户访问此表(以及配置存储中的其他表)。在您的情况下,controluser参数为空,因此查询失败。
For a short-term fix, put the "//" characters in config.inc.php at the start of this line:
对于短期修复,请将config.inc.php中的“//”字符放在此行的开头:
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
then log out and log back in.
然后注销并重新登录。
For a long-term fix, correctly set up the configuration storage, see http://docs.phpmyadmin.net/en/latest/setup.html#phpmyadmin-configuration-storage
要进行长期修复,请正确设置配置存储,请参阅http://docs.phpmyadmin.net/en/latest/setup.html#phpmyadmin-configuration-storage
#2
7
There is another way of solving this.
还有另一种解决方法。
Following the instructions in http://docs.phpmyadmin.net/en/latest/setup.html#phpmyadmin-configuration-storage:
按照http://docs.phpmyadmin.net/en/latest/setup.html#phpmyadmin-configuration-storage中的说明操作:
1.- I opned xampp\phpMyAdmin\config.inc.php file and found the following lines:
1.-我选择了xampp \ phpMyAdmin \ config.inc.php文件并找到以下行:
/* User for advanced features */\\
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = '';
2.- Then I observed in phpmyadmin the following tables:
2.-然后我在phpmyadmin中观察到以下表格:
DATABASE: phpmyadmin
数据库:phpmyadmin
TABLES: pma_bookmark pma_column_info pma_designer_coords pma_history pma_pdf_pages pma_recent pma_relation pma_table_coords pma_table_info pma_table_uiprefs pma_tracking pma_userconfig
表格:pma_bookmark pma_column_info pma_designer_coords pma_history pma_pdf_pages pma_recent pma_relation pma_table_coords pma_table_info pma_table_uiprefs pma_tracking pma_userconfig
3.- I run this sql statement:
3.-我运行这个sql语句:
GRANT SELECT , INSERT , UPDATE , DELETE ON phpmyadmin.* TO `pma`@`localhost` IDENTIFIED BY ''
And it worked.
它奏效了。
#3
4
On ubuntu, try dpkg-reconfigure phpmyadmin and recreate the phpmyadmin database. I installed using ansible and this was not done.
在ubuntu上,尝试dpkg-reconfigure phpmyadmin并重新创建phpmyadmin数据库。我使用ansible安装,但没有完成。
#4
3
-
Open the config.inc.php file from C:\xampp\phpmyadmin
从C:\ xampp \ phpmyadmin打开config.inc.php文件
-
Put the "//" characters in config.inc.php at the start of below line:
将config.inc.php中的“//”字符放在下面一行的开头:
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
$ cfg ['Servers'] [$ i] ['pmadb'] ='phpmyadmin';
Example: // $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
示例:// $ cfg ['Servers'] [$ i] ['pmadb'] ='phpmyadmin';
-
Reload your phpmyadmin at localhost.
在localhost重新加载您的phpmyadmin。
#5
2
I stumble upon this issue and I solved it just by logging out of phpMyAdmin and in again.
我偶然发现了这个问题,我只是通过注销phpMyAdmin再次解决了这个问题。
EXPLANATION
Take a look at the error message query:
看一下错误消息查询:
SELECT command denied to user ''@'localhost' for table 'pma_table_uiprefs'
This happens due to MySQL denying access to user "" (blank) at server localhost
. The default setting is to block all requests from anonymous users.
这是因为MySQL拒绝在服务器localhost访问用户“”(空白)。默认设置是阻止来自匿名用户的所有请求。
By logging out we force phpMyAdmin to "forget" the current user and let us input the login credentials for the MySQL server.
通过注销,我们强制phpMyAdmin“忘记”当前用户,让我们输入MySQL服务器的登录凭据。
#6
1
If you use XAMPP Path ( $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin'; ) C:\xampp\phpmyadmin\config.inc.php (Probably XAMPP1.8 at Line Number 34)
如果你使用XAMPP路径($ cfg ['Servers'] [$ i] ['pmadb'] ='phpmyadmin';)C:\ xampp \ phpmyadmin \ config.inc.php(可能是第34行的XAMPP1.8)
Another Solution: I face same type problem "#1142 - SELECT command denied to user ''@'localhost' for table 'pma_recent'"
另一个解决方案:我面临同样类型的问题“#1142 - 用户''@ localhost'拒绝SELECT表命令'pma_recent'”
- open phpmyadmin==>setting==>Navigation frame==> Recently used tables==>0(set the value 0) ==> Save
- 打开phpmyadmin ==>设置==>导航框架==>最近使用的表格==> 0(设置值0)==>保存
#7
0
I know this may sound absurd, but I solved a similar issue by creating the database as "phpMyAdmin" not "phpmyadmin" (note case) - perhaps there is something about case-sensitivity under Windows?
我知道这听起来很荒谬,但我通过创建数据库“phpMyAdmin”而不是“phpmyadmin”(注意案例)解决了类似的问题 - 也许在Windows下有一些关于区分大小写的东西?
#8
0
Commenting out this line worked for me: $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin'; But I found several config.inc.php files on my computer because I had a couple installations of MySQL and php haha. I changed it by finding the one under Xampp by just clicking on the config button under Apache for the Xampp control panel then commenting out the line. //
评论出这条线对我有用:$ cfg ['Servers'] [$ i] ['pmadb'] ='phpmyadmin';但我在我的计算机上发现了几个config.inc.php文件,因为我有几个安装的MySQL和php哈哈。我通过在Xampp控制面板上单击Apache下的配置按钮然后注释掉该行来找到Xampp下的那个。 //
#9
0
One way to resolve this is to login to your root user in phpmyadmin, go to the users tab, find and select the specific user that can't access the select and other queries . Then tick the all checkboxes and just click go. Now that user can select, update and whatever they want.
解决此问题的一种方法是在phpmyadmin中登录root用户,转到“用户”选项卡,查找并选择无法访问select和其他查询的特定用户。然后勾选所有复选框,然后单击go。现在用户可以选择,更新和他们想要的任何东西。
#10
0
The phpMyAdmin configuration directory is not fully configured, some of the extensions are disabled. Find out why. http://localhost:8080/phpmyadmin/doc/html/setup.html#linked-tables
phpMyAdmin配置目录未完全配置,某些扩展已禁用。找出为什么。 HTTP://本地主机:8080 / phpMyAdmin的/ DOC / HTML / setup.html#链接表