无法使用这些参数连接到数据库,我上传了我的本地项目在我的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