mysqli_real_connect() : (HY000/1698): Access denied for user 'root' @'localhost' - getting this error after my mac restarted itself

标签 mysql mariadb

我在我的计算机上启动并运行了 Valet - 直到昨天我的计算机重新启动时它都工作正常,现在我收到此错误

mysqli_real_connect(): (HY000/1698): 用户“root”@“localhost”访问被拒绝

我不明白为什么它有一天可以工作,然后第二天就坏了......

我担心更改任何设置都会破坏它,因为它在昨天之前正在工作......

编辑:其他类似的问题似乎不适用于 MariaDB,如果我尝试更改权限或更新用户,我会收到此错误 ---

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'BY 'root'' at line 1

最佳答案

检查您的 .env 文件;并根据 config/database.php 进行确认;检查提供的凭据是否正确。

关于mysqli_real_connect() : (HY000/1698): Access denied for user 'root' @'localhost' - getting this error after my mac restarted itself,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57783010/

相关文章:

PHP 和 MySQL 计数器

mysql - 为 MySQL 服务器配置 my.cnf 和 mariadb-server.cnf 文件有什么意义?它们是如何连接的?

java - 在结果集开始之前

mysql - 如何将两个SQL表的数据合并到一个新的SQL表中?

mysql - TIMEDIFF 子查询在 mariadb 中返回多于 1 行

mysql - 查询返回有关嵌套元素的数据

php - 无法更改 PHP MySQLi 连接的字符集

php - 错误的 COM_STMT_PREPARE 响应大小。收到 7. LARAVEL ERROR

mysql - 我应该使用 MySQL Cluster、Master to Master 复制还是其他?

mysql - 将 XML 文件自动转换为 SQL 数据库的方法?