📌  相关文章
📜  Illuminate\Database\QueryException : SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost' - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:26.501000             🧑  作者: Mango

代码示例1
$ sudo mysql -u root -p
Now you can add a new MySQL user with the username of your choice.

mysql> CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
And finally grant superuser privileges to the user you just created.

mysql> GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';

after that go and edit .env DB_USERNAME=newuser
DB_PASSWORD=password