Can't access Phpmyadmin in ubuntu error mysqli_real_connect(): (HY000/2002)
Posted
技术标签:
【中文标题】Can\'t access Phpmyadmin in ubuntu error mysqli_real_connect(): (HY000/2002)【英文标题】:Can't access Phpmyadmin in ubuntu error mysqli_real_connect(): (HY000/2002)Can't access Phpmyadmin in ubuntu error mysqli_real_connect(): (HY000/2002) 【发布时间】:2020-08-16 15:09:02 【问题描述】:我试图访问 phpmyadmin 但发生了这种情况
mysql said: Documentation
Cannot connect: invalid settings.
mysqli_real_connect(): (HY000/2002): No such file or directory
Connection for controluser as defined in your configuration failed.
mysqli_real_connect(): (HY000/2002): No such file or directory
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should
check the host, username and password in your configuration and make sure that they correspond to
the information given by the administrator of the MySQL server.
apache 和 mysql 正在运行,我的网站出现这样的错误
Warning: session_start(): open(/opt/lampp/temp//sess_ku01nv1mbiroo8btvpbqjv47f7, O_RDWR) failed: Permission denied (13) in /opt/lampp/htdocs/sisfo/index.php on line 2
有谁知道如何解决这个问题?
【问题讨论】:
在问题中包含namei -m /opt/lampp/temp/sess_ku01nv1mbiroo8btvpbqjv47f7
。你的 php 脚本以什么 unix 用户身份运行?
【参考方案1】:
mysqli_real_connect(): (HY000/2002): No such file or directory
似乎 phpmyadmin 试图连接到 mysql 套接字(它不存在?)。您可以尝试将config.inc.php
中的主机从localhost
更改为127.0.0.1
。
Warning: session_start(): open(...) failed: Permission denied (13)
您可能对临时文件夹有错误的权限/所有权。在你的 shell 中尝试这些命令:
chmod 777 /opt/lampp/temp
chown -R 33:33 /opt/lampp/temp
【讨论】:
我已经将 localhost 更改为 127.0.0.1 但仍然无法正常工作以上是关于Can't access Phpmyadmin in ubuntu error mysqli_real_connect(): (HY000/2002)的主要内容,如果未能解决你的问题,请参考以下文章
使用WAMP的phpMyadmin报错#1045 - Access denied for user ‘root‘@‘localhost‘ (using password:YES)
Can't get Access Token for Facebook SDK 4.8.1 for Android (OR) FacebookCallback is not called (OR) r
“You don't have permission to access /phpmyadmin/ on this server.”
Python 3 CSV 文件给出 UnicodeDecodeError: 'utf-8' codec can't decode byte error when I print
2002, "Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2)" i
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) when I