dppn67180 2015-01-31 11:52
浏览 217
已采纳

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". [] []
  • 写回答

3条回答 默认 最新

  • douya5194 2015-01-31 12:29
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记