【发布时间】:2020-12-18 02:51:00
【问题描述】:
我真的是 php 或 sql 等所有这些东西的菜鸟,所以我参加了 coursera 课程,他们告诉我们安装 LAMP。
我有 Linux 和 Apache2,但对于 MySql,我遵循了本教程 how to install LAMP。我跟着它,在我们必须运行sudo mysql 的地方之后,我得到了ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)。但根据教程我应该得到:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 22
Server version: 8.0.19-0ubuntu5 (Ubuntu)
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
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>
请任何人尽快帮助我解决这个问题,因为我正在学习的课程有截止日期。另外,如果网络上有任何可用的文档,请分享。
如果您需要有关错误的更多信息,请告诉我以及如何提取它们。
谢谢。
编辑:我的问题解决了,我在运行mysql -u root -p后能够输入密码
【问题讨论】:
-
您需要输入您的root密码。你应该在安装 mysql 时被要求创建一个
-
没有提示我在终端中可以输入密码的任何区域。但是,当我运行 mysql -u root -p 时,我能够输入密码并解决问题
-
这个答案完全为我解决了:askubuntu.com/a/784347
-
这个答案为我解决了同样的问题 100%:askubuntu.com/a/784347
标签: php mysql lamp apache2.4 ubuntu-20.04