Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-core/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
配置中定义的controluser的phpMyAdmin连接失败_Phpmyadmin - Fatal编程技术网

配置中定义的controluser的phpMyAdmin连接失败

配置中定义的controluser的phpMyAdmin连接失败,phpmyadmin,Phpmyadmin,所以,今天我第一次在Ubuntu 15.10上安装了XAMPP/LAMPP。Apache服务器工作正常,但当我尝试转到“localhost/phpmyadmin”时,出现以下错误: 相信我,我搜索了整个互联网、堆栈溢出、apache朋友等等,但没有一个解决方案适合我。。。这是我的config.inc.php文件: <?php $i++; /* Authentication type */ $cfg['Servers'][$i]['auth_type'] = 'cookie'; $cfg

所以,今天我第一次在Ubuntu 15.10上安装了XAMPP/LAMPP。Apache服务器工作正常,但当我尝试转到“localhost/phpmyadmin”时,出现以下错误:

相信我,我搜索了整个互联网、堆栈溢出、apache朋友等等,但没有一个解决方案适合我。。。这是我的config.inc.php文件:

<?php
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie'; 
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
/* Server parameters */
//$cfg['Servers'][$i]['host'] = 'localhost';
//$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = true;

/**
 * phpMyAdmin configuration storage settings.
*/

/* User used to manipulate with storage */
// $cfg['Servers'][$i]['controlhost'] = '';
// $cfg['Servers'][$i]['controlport'] = '';
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = '';

/* Storage database and tables */
$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]['table_uiprefs'] = 'pma__table_uiprefs';
$cfg['Servers'][$i]['tracking'] = 'pma__tracking';
$cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
$cfg['Servers'][$i]['recent'] = 'pma__recent'; 
// $cfg['Servers'][$i]['favorite'] = 'pma__favorite';
// $cfg['Servers'][$i]['users'] = 'pma__users'; 
// $cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
// $cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
// $cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
// $cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
 // $cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';
 // $cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';
/* Contrib / Swekey authentication */
// $cfg['Servers'][$i]['auth_swekey_config'] = '/etc/swekey-pma.conf';
取消注释:

$cfg['Servers'][$i]['user']='root';
$cfg['Servers'][$i]['password']='';
/*服务器参数*/

$cfg['Servers'][$i]['host']='localhost'// 首先在config.inc.php中注释掉controluser和controlpass行。然后,您可以使用root用户登录,并使用“特权”或“用户帐户”菜单添加此pma用户。在.

找到文件
config.default.php
并替换

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

然后登录。

重新安装phpmyadmin并重试

代码:

sudo dpkg重新配置phpmyadmin

如果这不起作用,那就试试看 代码:

sudo apt get--清除删除phpmyadmin

然后重新安装,如果这不起作用,我愿意打赌这没关系,也行 代码:

sudo ln-s/etc/phpmyadmin/apache.conf/etc/apache2/conf.d/phpmyadmin.conf

然后重新启动apache 代码:

##sudo/etc/init.d/apache-reload
sudo服务apache2重新加载

清除phpmyadmin并重新安装对我来说很有效

使用以下命令清除phpmyadmin:

    sudo apt-get purge --auto-remove phpmyadmin
然后再次安装:

    sudo apt-get install phpmyadmin

根据您发布的
config.inc.php
,您的根用户密码是1234(正如我在
$cfg['Servers'][$I]['password']='1234'
;)一行中看到的那样),但是稍后在文件中定义controluser时,您使用了一个空白密码

我建议设置一个实际的controluser,其权限比root用户的权限少,但快速修复方法是编辑并使其 更改:
$cfg['Servers'][$i]['controlpass']='1234'

要创建controluser帐户,请使用与以下类似的SQL命令:

GRANT SELECT, INSERT, UPDATE, DELETE ON <pma_db>.* TO 'pma'@'localhost'  IDENTIFIED BY 'pmapass';
GRANT SELECT、INSERT、UPDATE、DELETE ON.*到由“pmapass”标识的“pma”@“localhost”;

将phpMyAdmin配置存储数据库的名称(可能是“phpMyAdmin”)替换为
,并将自定义密码替换为
pmapass。

我也遇到了同样的情况。但我是这样修好的。只要在出现错误时重新启动浏览器,然后再次登录phpMyAdmin。无需代码,无需配置操作

sudo chown-R mysql:mysql/var/lib/mysql


为我工作。

嘿,伙计,不需要更改任何文件。。 基本上是因为你的mysqli没有运行。。 检查控制面板上的“操作”列。您应该看到“Start”表示关闭,您的php无法与处于睡眠状态的数据库门进行对话。。 这就是为什么

要解决它。。。 打开安装xampp应用程序的文件夹,然后单击xammp开始,然后接受所有必要的批准

sudo reboot
如果不是自动启动,则启动mysql

sudo service mysql start

我也有类似的问题。我能够按照视频教程进行修复

我刚刚在我的.ini文件中添加了跳过授权表。下面是my.ini文件的示例部分

# Example MySQL config file for small systems.
#
# This is for a system with little memory (<= 64M) where MySQL is only used
# from time to time and it's important that the mysqld daemon
# doesn't use much resources.
#
# You can copy this file to
# C:/xampp/mysql/bin/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is C:/xampp/mysql/data) or
# ~/.my.cnf to set user-specific options.
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.

# The following options will be passed to all MySQL clients
[client]
# password       = your_password 
port=3306
socket="C:/xampp/mysql/mysql.sock"


# Here follows entries for some specific programs 

# The MySQL server
default-character-set=utf8mb4
[mysqld]
skip-grant-tables
port=3306
socket="C:/xampp/mysql/mysql.sock"
basedir="C:/xampp/mysql"
tmpdir="C:/xampp/tmp"
datadir="C:/xampp/mysql/data"
pid_file="mysql.pid"
# enable-named-pipe
key_buffer=16M
max_allowed_packet=1M
sort_buffer_size=512K
net_buffer_length=8K
read_buffer_size=256K
read_rnd_buffer_size=512K
myisam_sort_buffer_size=8M
log_error="mysql_error.log"

小型系统的MySQL配置文件示例。 #
#这是一个内存很少的系统(谢谢你的回答。我现在试过了,但没有解决。好的。你的配置文件肯定还有其他问题。如果我对这两行进行注释,我会在我的机器上得到完全相同的错误。你有用户“pma”吗此MySQL服务器中未定义密码?因为您的配置要求phpMyAdmin尝试与此类用户建立连接。不,我没有在MySQL服务器中定义任何内容?您能解释一下我应该怎么做吗?请参阅下面我的新答案。当我在config.inc.php中注释掉“controluser”和“controlpass”并尝试以root用户身份登录时“配置中定义的controluser连接失败”错误消失,但“无法登录到MySQL服务器”“停留。这意味着你没有正确的登录信息,或者MySQL服务器没有运行。好了,伙计,我没有从XAMPP管理器运行MySQL服务器。谢谢你的回答,伙计,你是传奇人物。在这方面花了这么多时间……无论如何,非常感谢你。
sudo service mysql start
# Example MySQL config file for small systems.
#
# This is for a system with little memory (<= 64M) where MySQL is only used
# from time to time and it's important that the mysqld daemon
# doesn't use much resources.
#
# You can copy this file to
# C:/xampp/mysql/bin/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is C:/xampp/mysql/data) or
# ~/.my.cnf to set user-specific options.
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.

# The following options will be passed to all MySQL clients
[client]
# password       = your_password 
port=3306
socket="C:/xampp/mysql/mysql.sock"


# Here follows entries for some specific programs 

# The MySQL server
default-character-set=utf8mb4
[mysqld]
skip-grant-tables
port=3306
socket="C:/xampp/mysql/mysql.sock"
basedir="C:/xampp/mysql"
tmpdir="C:/xampp/tmp"
datadir="C:/xampp/mysql/data"
pid_file="mysql.pid"
# enable-named-pipe
key_buffer=16M
max_allowed_packet=1M
sort_buffer_size=512K
net_buffer_length=8K
read_buffer_size=256K
read_rnd_buffer_size=512K
myisam_sort_buffer_size=8M
log_error="mysql_error.log"