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条)

报告相同问题?

悬赏问题

  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)