MySQL 尽管以 root 用户身份登录,phpMyAdmin 表示没有创建数据库的权限

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11427091/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 14:07:35  来源:igfitidea点击:

phpMyAdmin says no privilege to create database, despite logged in as root user

mysqlphpmyadmin

提问by Udee

I need to login to mysql using root user and create a database. However, when I login to PhpMyAdmin as root user, it tells me that it has "no privileges", therefore cannot create a database.

我需要使用 root 用户登录到 mysql 并创建一个数据库。但是,当我以 root 用户身份登录 PhpMyAdmin 时,它告诉我它“没有权限”,因此无法创建数据库。

I did not expect this to happen when I installed phpMyAdmin. Is there a way to fix this? Please help, thank you!

当我安装 phpMyAdmin 时,我没想到会发生这种情况。有没有办法来解决这个问题?请帮忙,谢谢!

Version info:

版本信息:

OS: OpenSUSE 12.1

操作系统:OpenSUSE 12.1

MySQL: mysql Ver 14.14 Distrib 5.5.25, for Linux (x86_64) using readline 6.2

MySQL: mysql Ver 14.14 Distrib 5.5.25, for Linux (x86_64) using readline 6.2

PhpMyAdmin: 3.4.10.2

PhpMyAdmin:3.4.10.2

采纳答案by Oh Chin Boon

It appears to be a transient issue and fixed itself afterwards. Thanks for everyone's attention.

这似乎是一个暂时的问题,后来自行修复。谢谢大家的关注。

回答by Avinash

If you are using Chrome. try some other browser. there where previous posts on this issue saying that phpmyadmin didnot provide privileges for root on chrome.

如果您使用的是 Chrome。尝试使用其他浏览器。以前关于这个问题的帖子说 phpmyadmin 没有为 chrome 上的 root 提供权限。

or try this

或者试试这个

name: root

名称:根

password: password

密码:密码

回答by Udee

Login using the system maintenance user and password created when you installed phpMyAdmin.
It can be found in the debian.cnf file at /ect/mysql then you will have total access.

使用安装 phpMyAdmin 时创建的系统维护用户和密码登录。
它可以在 /ect/mysql 的 debian.cnf 文件中找到,然后您将拥有完全访问权限。

cd /etc/mysql
sudo nano debian.cnf
Just look - don't change anything!
[mysql_upgrade]
host     = localhost
user     = debian-sys-maint       <----use this user
password = s0meRaND0mChar$s       <----use this password
socket   = /var/run/mysqld/mysqld.sock

Worked for me.

为我工作。

回答by Adnan

This worked for me

这对我有用

open config.inc.php file in phpmyadmin root, set auth type from cookie to config

在 phpmyadmin root 中打开 config.inc.php 文件,将 auth 类型从 cookie 设置为 config

$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = ''; // leave blank if no password

回答by Moaz B

Use these:

使用这些:

  • username : root
  • password : (nothing)
  • 用户名:根
  • 密码:(无)

Then you will get the page you want (more options than the admin page) with privileges.

然后您将获得您想要的页面(比管理页面更多的选项)具有特权。

回答by Oh Chin Boon

Look at the user and host column of your permission. Where you are coming from localhost or some other IPs do make a difference.

查看您的权限的用户和主机列。您来自本地主机或其他一些 IP 的位置确实有所不同。

回答by Pedro Sousa

This worked for me(in Chrome):

这对我有用(在 Chrome 中):

Login to phpmyadmin, and follow "Home" -> "Privileges" -> "Reload the Privileges". After this, clear your browser's cache and retry.

登录到 phpmyadmin,然后按照"Home" -> "Privileges" -> "Reload the Privileges". 之后,清除浏览器的缓存并重试。

Regards, Pedro Sousa

问候,佩德罗·苏萨

回答by Douglas Tondo

login in the terminal as a root and execute this command:

以 root 身份登录终端并执行以下命令:

mysql_secure_installation

mysql_secure_installation

Type n in order to not change root password and hit enter, then type y to remove anonymous users and hit enter. Type n if you want to disallow root login remotely and hit enter. Now type y to remove test tables and databases and hit enter, then type y again and hit enter.

键入 n 以不更改 root 密码并按回车键,然后键入 y 以删除匿名用户并按回车键。如果您想远程禁止 root 登录,请键入 n 并按回车键。现在键入 y 以删除测试表和数据库并按回车键,然后再次键入 y 并按回车键。

and you are good to go :)

你很高兴去:)

回答by Erdem Güng?r

I solved my issue like that. You need the change auth_type 'config' to 'http'. My older settings auth_type is 'config' then i changed to 'http' and problem solved.

我就这样解决了我的问题。您需要将 auth_type 'config' 更改为 'http'。我的旧设置 auth_type 是“config”,然后我改为“http”,问题解决了。

When you changed that area and enter the phpMyAdmin, browser asks you a user and password. You just enter 'root' and dont fill the password area and press enter.

当您更改该区域并进入 phpMyAdmin 时,浏览器会要求您输入用户名和密码。您只需输入“root”而不填写密码区域并按回车键。

/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'http';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';

回答by user5256497

My problem was on my KSWEB app that I downloaded. I am having no privileges error, but when I opened my config.inc.php and changed

我的问题出在我下载的 KSWEB 应用程序上。我没有权限错误,但是当我打开 config.inc.php 并更改时

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

to

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

It worked and I now have privileges to create a database.

它起作用了,我现在有权创建数据库。