無法使用這些參數連接到數據庫,我上傳了我的本地項目在我的cPanel,但我沒有使它的工作。無法連接到數據庫Symfony 3
錯誤消息:
{ 「代碼」:500, 「消息」:「在驅動時發生異常:SQLSTATE [HY000] [2003]無法連接到MySQL服務器上「127.0。 0.1' (111)「}
日誌:
[2017-05-08 10:37:09] request.INFO: Matched route "get_users". {"route":"get_users","route_parameters":{"_controller":"SwipeBundle\\Controller\\Backend\\API\\UserController::getUsersAction","_format":"json","_route":"get_users"},"request_uri":"http://swipe.com.ph/api/users","method":"GET"} []
[2017-05-08 10:37:09] security.DEBUG: Checking for guard authentication credentials. {"firewall_key":"main","authenticators":3} []
[2017-05-08 10:37:09] security.DEBUG: Calling getCredentials() on guard configurator. {"firewall_key":"main","authenticator":"SwipeBundle\\Security\\LoginFormAuthenticator"} []
[2017-05-08 10:37:09] security.DEBUG: Calling getCredentials() on guard configurator. {"firewall_key":"main","authenticator":"SwipeBundle\\Security\\AdminLoginFormAuthenticator"} []
[2017-05-08 10:37:09] security.DEBUG: Calling getCredentials() on guard configurator. {"firewall_key":"main","authenticator":"SwipeBundle\\Security\\AccountLoginFormAuthenticator"} []
[2017-05-08 10:37:09] security.INFO: Populated the TokenStorage with an anonymous Token. [] []
[2017-05-08 10:37:09] request.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\DriverException: "An exception occured in driver: SQLSTATE[HY000] [2003] Can't connect to MySQL server on '127.0.0.1' (111)" at /home/swipecom/contactless/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 115 {"exception":"[object] (Doctrine\\DBAL\\Exception\\DriverException(code: 0): An exception occured in driver: SQLSTATE[HY000] [2003] Can't connect to MySQL server on '127.0.0.1' (111) at /home/swipecom/contactless/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:115, Doctrine\\DBAL\\Driver\\PDOException(code: 2003): SQLSTATE[HY000] [2003] Can't connect to MySQL server on '127.0.0.1' (111) at /home/swipecom/contactless/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:47, PDOException(code: 2003): SQLSTATE[HY000] [2003] Can't connect to MySQL server on '127.0.0.1' (111) at /home/swipecom/contactless/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:43)"} []
Parameters.yml
parameters:
database_driver: pdo_mysql
database_host: 127.0.0.1
database_port: 3306
database_name: com_contactless
database_user: com_swipe
database_password: Js121716
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: null
mailer_password: null
secret: ThisTokenIsNotSoSecretChangeIt
我在parametes.yml
檢查的價值觀和我發誓,他們是正確的
數據庫端口通常是3306 – Scriptable
可能是主機不正確。許多託管服務在不同的機器上都有數據庫 – Volvox
我更新我的代碼,請檢查。 – phpmeter