简体   繁体   English

SQLSTATE[HY000] [1045] 用户 'root'@'localhost' 的访问被拒绝(使用密码:NO)(SQL:select * from `rooms` order by `order_by` asc)

[英]SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) (SQL: select * from `rooms` order by `order_by` asc)

my code run fine in localhost but when i uploaded it on the serve following error show我的代码在 localhost 中运行良好,但是当我将其上传到服务器上时,出现以下错误

Illuminate \\ Database \\ QueryException (1045) SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) (SQL: select * from rooms order by order_by asc) Previous exceptions SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) (1045) Illuminate \\ Database \\ QueryException (1045) SQLSTATE[HY000] [1045] 用户 'root'@'localhost' 访问被拒绝(使用密码:NO)(SQL:select * from rooms order by order_by asc)以前的异常 SQLSTATE[HY000] [1045] 用户 'root'@'localhost' 的访问被拒绝(使用密码:NO)(1045)

APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:tT9jGFWVeBX5uLy/CVZbs8k+RNGBpMyJ526xfRv3DKQ=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=janatapa_shre
DB_USERNAME=janatapa_shre
DB_PASSWORD=Shre@123

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

though i have changed the database name , user and password in .env file it still says "Access denied for user 'root'@'localhost' (using password: NO)" which was my localhost password and user name''虽然我已经更改了 .env 文件中的数据库名称、用户和密码,但它仍然显示“用户'root'@'localhost' 的访问被拒绝(使用密码:NO)” ,这是我的本地主机密码和用户名''

I couldnt even clear my cache我什至无法清除我的缓存

while i was try to use following code on server当我尝试在服务器上使用以下代码时

php artisan cache:clear
php artisan config:clear
php artisan config:cache
php artisan view:clear

the following error was shown on the terminal终端上显示以下错误

[In Connection.php line 664: [在 Connection.php 第 664 行:

SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using pas SQLSTATE[HY000] [1045] 用户 'root'@'localhost' 的访问被拒绝(使用 pas
sword: NO) (SQL: select * from rooms order by order_by asc)剑: 否) (SQL: select * from rooms order by order_by asc)

In Connector.php line 70:在 Connector.php 第 70 行:

SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using pas SQLSTATE[HY000] [1045] 用户 'root'@'localhost' 的访问被拒绝(使用 pas
sword: NO) ] 1剑:否)] 1

my code run fine in localhost but when i uploaded it on the serve following error show我的代码在本地主机上运行良好,但是当我将其上传到服务以下错误显示时

Illuminate \\ Database \\ QueryException (1045) SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) (SQL: select * from rooms order by order_by asc) Previous exceptions SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) (1045) Illuminate \\ Database \\ QueryException(1045)SQLSTATE [HY000] [1045]用户'root'@'localhost'的访问被拒绝(使用密码:NO)(SQL:从*按order_by asc排序的rooms选择*)先前的异常SQLSTATE [HY000] [1045]对用户'root'@'localhost'的访问被拒绝(使用密码:否)(1045)

APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:tT9jGFWVeBX5uLy/CVZbs8k+RNGBpMyJ526xfRv3DKQ=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=janatapa_shre
DB_USERNAME=janatapa_shre
DB_PASSWORD=Shre@123

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

though i have changed the database name , user and password in .env file it still says "Access denied for user 'root'@'localhost' (using password: NO)" which was my localhost password and user name''尽管我已经更改了.env文件中的数据库名称,用户名和密码,但它仍然显示“用户'root'@'localhost'的访问被拒绝(使用密码:否)” ,这是我的localhost密码和用户名。

I couldnt even clear my cache我什至无法清除缓存

while i was try to use following code on server当我尝试在服务器上使用以下代码时

php artisan cache:clear
php artisan config:clear
php artisan config:cache
php artisan view:clear

the following error was shown on the terminal在终端上显示以下错误

[In Connection.php line 664: [在Connection.php第664行中:

SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using pas SQLSTATE [HY000] [1045]对用户'root'@'localhost'的访问被拒绝(使用pas
sword: NO) (SQL: select * from rooms order by order_by asc)剑:否)(SQL:从按order_by asc排序的rooms选择*)

In Connector.php line 70:在Connector.php第70行中:

SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using pas SQLSTATE [HY000] [1045]对用户'root'@'localhost'的访问被拒绝(使用pas
sword: NO) ] 1剑:否)] 1

my code run fine in localhost but when i uploaded it on the serve following error show我的代码在本地主机上运行良好,但是当我将其上传到服务以下错误显示时

Illuminate \\ Database \\ QueryException (1045) SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) (SQL: select * from rooms order by order_by asc) Previous exceptions SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) (1045) Illuminate \\ Database \\ QueryException(1045)SQLSTATE [HY000] [1045]用户'root'@'localhost'的访问被拒绝(使用密码:NO)(SQL:从*按order_by asc排序的rooms选择*)先前的异常SQLSTATE [HY000] [1045]对用户'root'@'localhost'的访问被拒绝(使用密码:否)(1045)

APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:tT9jGFWVeBX5uLy/CVZbs8k+RNGBpMyJ526xfRv3DKQ=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=janatapa_shre
DB_USERNAME=janatapa_shre
DB_PASSWORD=Shre@123

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

though i have changed the database name , user and password in .env file it still says "Access denied for user 'root'@'localhost' (using password: NO)" which was my localhost password and user name''尽管我已经更改了.env文件中的数据库名称,用户名和密码,但它仍然显示“用户'root'@'localhost'的访问被拒绝(使用密码:否)” ,这是我的localhost密码和用户名。

I couldnt even clear my cache我什至无法清除缓存

while i was try to use following code on server当我尝试在服务器上使用以下代码时

php artisan cache:clear
php artisan config:clear
php artisan config:cache
php artisan view:clear

the following error was shown on the terminal在终端上显示以下错误

[In Connection.php line 664: [在Connection.php第664行中:

SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using pas SQLSTATE [HY000] [1045]对用户'root'@'localhost'的访问被拒绝(使用pas
sword: NO) (SQL: select * from rooms order by order_by asc)剑:否)(SQL:从按order_by asc排序的rooms选择*)

In Connector.php line 70:在Connector.php第70行中:

SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using pas SQLSTATE [HY000] [1045]对用户'root'@'localhost'的访问被拒绝(使用pas
sword: NO) ] 1剑:否)] 1

my code run fine in localhost but when i uploaded it on the serve following error show我的代码在本地主机上运行良好,但是当我将其上传到服务以下错误显示时

Illuminate \\ Database \\ QueryException (1045) SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) (SQL: select * from rooms order by order_by asc) Previous exceptions SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) (1045) Illuminate \\ Database \\ QueryException(1045)SQLSTATE [HY000] [1045]用户'root'@'localhost'的访问被拒绝(使用密码:NO)(SQL:从*按order_by asc排序的rooms选择*)先前的异常SQLSTATE [HY000] [1045]对用户'root'@'localhost'的访问被拒绝(使用密码:否)(1045)

APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:tT9jGFWVeBX5uLy/CVZbs8k+RNGBpMyJ526xfRv3DKQ=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=janatapa_shre
DB_USERNAME=janatapa_shre
DB_PASSWORD=Shre@123

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

though i have changed the database name , user and password in .env file it still says "Access denied for user 'root'@'localhost' (using password: NO)" which was my localhost password and user name''尽管我已经更改了.env文件中的数据库名称,用户名和密码,但它仍然显示“用户'root'@'localhost'的访问被拒绝(使用密码:否)” ,这是我的localhost密码和用户名。

I couldnt even clear my cache我什至无法清除缓存

while i was try to use following code on server当我尝试在服务器上使用以下代码时

php artisan cache:clear
php artisan config:clear
php artisan config:cache
php artisan view:clear

the following error was shown on the terminal在终端上显示以下错误

[In Connection.php line 664: [在Connection.php第664行中:

SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using pas SQLSTATE [HY000] [1045]对用户'root'@'localhost'的访问被拒绝(使用pas
sword: NO) (SQL: select * from rooms order by order_by asc)剑:否)(SQL:从按order_by asc排序的rooms选择*)

In Connector.php line 70:在Connector.php第70行中:

SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using pas SQLSTATE [HY000] [1045]对用户'root'@'localhost'的访问被拒绝(使用pas
sword: NO) ] 1剑:否)] 1

my code run fine in localhost but when i uploaded it on the serve following error show我的代码在本地主机上运行良好,但是当我将其上传到服务以下错误显示时

Illuminate \\ Database \\ QueryException (1045) SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) (SQL: select * from rooms order by order_by asc) Previous exceptions SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) (1045) Illuminate \\ Database \\ QueryException(1045)SQLSTATE [HY000] [1045]用户'root'@'localhost'的访问被拒绝(使用密码:NO)(SQL:从*按order_by asc排序的rooms选择*)先前的异常SQLSTATE [HY000] [1045]对用户'root'@'localhost'的访问被拒绝(使用密码:否)(1045)

APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:tT9jGFWVeBX5uLy/CVZbs8k+RNGBpMyJ526xfRv3DKQ=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=janatapa_shre
DB_USERNAME=janatapa_shre
DB_PASSWORD=Shre@123

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

though i have changed the database name , user and password in .env file it still says "Access denied for user 'root'@'localhost' (using password: NO)" which was my localhost password and user name''尽管我已经更改了.env文件中的数据库名称,用户名和密码,但它仍然显示“用户'root'@'localhost'的访问被拒绝(使用密码:否)” ,这是我的localhost密码和用户名。

I couldnt even clear my cache我什至无法清除缓存

while i was try to use following code on server当我尝试在服务器上使用以下代码时

php artisan cache:clear
php artisan config:clear
php artisan config:cache
php artisan view:clear

the following error was shown on the terminal在终端上显示以下错误

[In Connection.php line 664: [在Connection.php第664行中:

SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using pas SQLSTATE [HY000] [1045]对用户'root'@'localhost'的访问被拒绝(使用pas
sword: NO) (SQL: select * from rooms order by order_by asc)剑:否)(SQL:从按order_by asc排序的rooms选择*)

In Connector.php line 70:在Connector.php第70行中:

SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using pas SQLSTATE [HY000] [1045]对用户'root'@'localhost'的访问被拒绝(使用pas
sword: NO) ] 1剑:否)] 1

my code run fine in localhost but when i uploaded it on the serve following error show我的代码在本地主机上运行良好,但是当我将其上传到服务以下错误显示时

Illuminate \\ Database \\ QueryException (1045) SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) (SQL: select * from rooms order by order_by asc) Previous exceptions SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) (1045) Illuminate \\ Database \\ QueryException(1045)SQLSTATE [HY000] [1045]用户'root'@'localhost'的访问被拒绝(使用密码:NO)(SQL:从*按order_by asc排序的rooms选择*)先前的异常SQLSTATE [HY000] [1045]对用户'root'@'localhost'的访问被拒绝(使用密码:否)(1045)

APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:tT9jGFWVeBX5uLy/CVZbs8k+RNGBpMyJ526xfRv3DKQ=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=janatapa_shre
DB_USERNAME=janatapa_shre
DB_PASSWORD=Shre@123

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

though i have changed the database name , user and password in .env file it still says "Access denied for user 'root'@'localhost' (using password: NO)" which was my localhost password and user name''尽管我已经更改了.env文件中的数据库名称,用户名和密码,但它仍然显示“用户'root'@'localhost'的访问被拒绝(使用密码:否)” ,这是我的localhost密码和用户名。

I couldnt even clear my cache我什至无法清除缓存

while i was try to use following code on server当我尝试在服务器上使用以下代码时

php artisan cache:clear
php artisan config:clear
php artisan config:cache
php artisan view:clear

the following error was shown on the terminal在终端上显示以下错误

[In Connection.php line 664: [在Connection.php第664行中:

SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using pas SQLSTATE [HY000] [1045]对用户'root'@'localhost'的访问被拒绝(使用pas
sword: NO) (SQL: select * from rooms order by order_by asc)剑:否)(SQL:从按order_by asc排序的rooms选择*)

In Connector.php line 70:在Connector.php第70行中:

SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using pas SQLSTATE [HY000] [1045]对用户'root'@'localhost'的访问被拒绝(使用pas
sword: NO) ] 1剑:否)] 1

If everything is ok with the .env file, and you set username and password correct.如果 .env 文件一切正常,并且您设置的用户名和密码正确。 Then in your project's path open the terminal and use this command,然后在您的项目路径中打开终端并使用此命令,

php artisan cache:clear php artisan 缓存:清除

I hope it'll be helpful.我希望它会有所帮助。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SQLSTATE [HY000] [1045] 用户'root'@'localhost'的访问被拒绝(使用密码:NO)(SQL:select *来自`permissions`) - SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) (SQL: select * from `permissions`) SQLSTATE[HY000] [1045] 用户 'root'@'localhost' 的访问被拒绝(使用密码:YES)(SQL:从 `cats` 中选择 *) - SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) (SQL: select * from `cats`) SQL: select * from users: SQLSTATE[HY000] [1045] 用户 'root'@'localhost' 访问被拒绝(使用密码:YES) - SQL: select * from users: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) SQLSTATE[HY000] [1045] 用户 'homestead'@'localhost' 的访问被拒绝(使用密码:YES)(SQL:从 `table` 中选择 *) - SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES) (SQL: select * from `table`) SQLSTATE[HY000] [1045] 使用 Mac Os 和 MAMP 拒绝用户 'root'@'localhost' 的访问(使用密码:否) - SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) using Mac Os and MAMP 错误!:SQLSTATE[HY000] [1045] 用户 'root'@'localhost' 访问被拒绝(使用密码:NO) - ERROR!:SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) 未捕获的 PDOException:SQLSTATE[HY000] [1045] 用户“root”@“localhost”的访问被拒绝(使用密码:否) - Uncaught PDOException: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) SQLSTATE [HY000] [1045] 用户'root'@'localhost'的访问被拒绝(使用密码:YES)symfony2 - SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) symfony2 无法迁移 SQLSTATE[HY000] [1045] 用户 'root'@'localhost' 的访问被拒绝(使用密码:YES) - Cannot migrate SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) (“SQLSTATE[HY000] [1045] 用户 'root'@'localhost' 访问被拒绝(使用密码:NO)”) - ("SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO)")
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM