简体   繁体   中英

PDOException in Connector.php line 47: SQLSTATE[HY000] [2002] Permission denied

I am working with Laravel 5. Its working fine on localhost. when i transfer live server from localhost it shows error when i am trying to login. PDOException in Connector.php line 47: SQLSTATE[HY000] [2002] Permission denied

I tried by changing localhost to 127.0.0.1 but it also not working.

If you are on CentOS, try to disable SELinux.

If you don't want to disable, go to Terminal, grant SU and

setsebool -P httpd_can_network_connect_db 1

Thanks to @Aung Myat for the last line.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM