在网页上产生的是:sqlstate[hy000] [1698] access denied for user 'root'@'localhost' (sql: select * from information_schema.tables where table_schema = laravel and table_name = categories and table_type = 'base table')
尝试:
php artisan config:cache,php artisan config:clear,php artisan cache:clear =>不工作,因为技工显示了mysql错误;所以技工是无用的,它必须是一个数据库问题,sudo systemctl restart mysql.service =>问题persistssudo poweroff =>问题持续存在发布于 2022-05-08 11:32:00
解决办法:
sudo mysql -u root -p =>以root用户身份登录mysql,密码为use mysql; =>使用mysql数据库UPDATE user SET plugin='mysql_native_password' WHERE USER='root'; =>将根的身份验证类型更改为mysql_native_passwordFLUSH PRIVILEGES; =>重新加载授权表service mysql restart =>重新启动mysql完成此操作后,应清除错误。
https://stackoverflow.com/questions/72160568
复制相似问题