【发布时间】:2021-12-07 00:15:29
【问题描述】:
我正在使用带有 xampp 的 Linux,我遇到了 MySQL 的问题。
当我使用此命令sudo /opt/lampp/lampp start 时,它会正确启动一切,而当我在 xampp 的 MySQL 已经运行时使用 sudo service mysql start 时,该命令会给我这个错误:
Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.
反之亦然,如果我在 MySQL 服务已经运行时使用此命令 sudo opt/lampp/lampp start,我会在 PHPMyAdmin 页面上收到此错误:
MySQL said:
Cannot connect: invalid settings.
mysqli::real_connect(): (HY000/2002): No such file or directory
Connection for controluser as defined in your configuration failed.
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.
除此之外:当我尝试命令 sudo mysql 和 show databases; 时,我得到的数据库与 PHPMyAdmin 上的不同,所以这些是来自 MySQL 命令的数据库:
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| Products |
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
5 rows in set (0.00 sec)
MySQL>
但这些是我在 PHPMyAdmin 中的数据库:
- 艾哈迈德
- information_schema
- mysql
- performance_schema
- phpmyadmin
- 产品
- 测试
它们完全不同,当我在其中一个上创建数据库时,它不会出现或不存在于另一个上,它们彼此无关。
这对我来说似乎很困惑,我不知道该怎么办,我已经尝试了所有方法,但我坚持了 4 天,不幸的是,我不是那种只会继续下去的人不了解问题出在哪里,尤其是在我学习的时候,所以如果有人对此有解决方案,那将不胜感激。
注意:我已经搜索了很多解决方案,在 youtube 上观看了几个小时,阅读并遵循了很多不起作用的解决方案,我还删除了 apache、Mysql 和 xampp完全从我的系统中重新安装并重新安装它,尽管它对其他人有用,但对我没有任何用处,所以我不是在这里浪费任何人的时间。
【问题讨论】:
-
请don't upload text as image。编辑您的问题以包含文本形式的所有信息 - 考虑使用编辑器的格式选项。另请参阅 How to Ask 和 help center。这看起来与我无关的编程
-
@OlafKock,非常感谢您通知我这一点,我已经用文本形式编辑了问题,我只是认为它会提供更多信息并且更容易通过图像阅读,所以再次感谢给我这个建议,我真的很感激。
标签: mysql linux apache phpmyadmin xampp