Symfony2无法连接到'192.168.1.50'上的MySQL服务器(113)

I have remote mysql server @192.168.1.50. I can access it through [http://192.168.1.50/phpmyadmin/] on my pc, or by using

ssh root@192.168.1.50

But in Symfony2 when I run

 php app/console doctrine:schema:update --force  gives me error

[PDOException]                                                               
  SQLSTATE[HY000] [2003] Can't connect to MySQL server on '192.168.1.50' (113  
 )

my parameter.yml

parameters:
database_driver: pdo_mysql
database_host: 192.168.1.50
database_port: 3306
database_name: xxhealthdb
database_user: kproduction
database_password: xxroot
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: null
mailer_password: null
locale: en
secret: ThisTokenIsNotSoSecretChangeIt                                                                          

I think there must be some thing wrong in this file or may be anything else from which I am unaware. Please help me

Note: I am using MariaDB and CentOS for remote server and Ubuntu for my(client) PC.

my log details

      2015-01-31 17:35:20] event.DEBUG: Notified event "console.command" to listener    "Symfony\Component\HttpKernel\EventListener\DebugHandlersListener::configure". [] []
    [2015-01-31 17:35:20] event.DEBUG: Notified event "console.command" to listener "Symfony\Bridge\Monolog\Handler\ConsoleHandler::onCommand". [] []
 [2015-01-31 17:35:20] event.DEBUG: Notified event "console.command" to listener "Symfony\Bridge\Monolog\Handler\ConsoleHandler::onCommand". [] []
  [2015-01-31 17:35:20] event.DEBUG: Notified event "console.terminate" to listener "Symfony\Bundle\SwiftmailerBundle\EventListener\EmailSenderListener::onTerminate". [] []
   [2015-01-31 17:35:20] event.DEBUG: Notified event "console.terminate" to listener "Symfony\Bridge\Monolog\Handler\ConsoleHandler::onTerminate". [] []
    [2015-01-31 17:35:20] event.DEBUG: Notified event "console.terminate" to listener "Symfony\Bridge\Monolog\Handler\ConsoleHandler::onTerminate". [] []

You've running MariaDB server and Symfony2 is trying to connect MySql server. Try to install MySQL server for centos7 and configure the MySql config file found under /etc/my.cfg.

Make sure [mysql] which is your server and [client] is allowing connection from default port 3306.

Make sure your centos firewall is allowing TCP public connection on 3306.

After configuring above changes restart your MySQL server and try again, it should work.

By default, The database server doesn't allow connections from the user apps. It might be a misconfiguration from your DB Server.

Try to attach the logs here so i can help you further.

Symfony2 Logs can be found in the : /app/logs directory.

Good luck!

Did you remember to add your IP in allow remote access? It might be one of the reason.