{"id":249,"date":"2018-12-07T01:30:37","date_gmt":"2018-12-07T01:30:37","guid":{"rendered":"https:\/\/dapliw.org.ve\/?p=249"},"modified":"2018-12-07T01:30:37","modified_gmt":"2018-12-07T01:30:37","slug":"cakephp-3-migrations-exception-there-was-a-problem-connecting-to-the-database","status":"publish","type":"post","link":"https:\/\/saemas.com\/sitio_web\/cakephp-3-migrations-exception-there-was-a-problem-connecting-to-the-database\/","title":{"rendered":"Cakephp 3 &#8211; Migrations, Exception: There was a problem connecting to the database"},"content":{"rendered":"<p>Si al intentar hacer una migraci\u00f3n en Cakephp 3 se muestra el siguiente error:<\/p>\n<pre>\nException: There was a problem connecting to the database: SQLSTATE[HY000] [2002] No such file or directory in [\/opt\/lampp\/htdocs\/aplication\/vendor\/robmorgan\/phinx\/src\/Phinx\/Db\/Adapter\/MysqlAdapter.php, line 121]\n<\/pre>\n<p>Para solucionarlo, abrir el archivo app.php, desplazarnos hasta la configuraci\u00f3n de la base de datos (Datasources) y cambiar el valor del par\u00e1metro &#8216;host&#8217; de &#8216;localhost&#8217; a &#8216;127.0.0.1&#8217;:<\/p>\n<pre>\n   'Datasources' => [\n        'default' => [\n            'className' => 'Cake\\Database\\Connection',\n            'driver' => 'Cake\\Database\\Driver\\Mysql',\n            'persistent' => false,\n            'host' => '127.0.0.1',\n<\/pre>\n<p>Guardar el archivo y ejecutar nuevamente el comando de migraci\u00f3n.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Si al intentar hacer una migraci\u00f3n en Cakephp 3 se muestra el siguiente error: Exception: There was a problem connecting to the database: SQLSTATE[HY000] [2002] No such file or directory in [\/opt\/lampp\/htdocs\/aplication\/vendor\/robmorgan\/phinx\/src\/Phinx\/Db\/Adapter\/MysqlAdapter.php, line 121] Para solucionarlo, abrir el archivo app.php, desplazarnos hasta la configuraci\u00f3n de la base de datos (Datasources) y cambiar el valor del [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"material-hide-sections":[],"footnotes":""},"categories":[11],"tags":[12],"class_list":["post-249","post","type-post","status-publish","format-standard","hentry","category-cakephp","tag-cakephp"],"_links":{"self":[{"href":"https:\/\/saemas.com\/sitio_web\/wp-json\/wp\/v2\/posts\/249","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/saemas.com\/sitio_web\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/saemas.com\/sitio_web\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/saemas.com\/sitio_web\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/saemas.com\/sitio_web\/wp-json\/wp\/v2\/comments?post=249"}],"version-history":[{"count":0,"href":"https:\/\/saemas.com\/sitio_web\/wp-json\/wp\/v2\/posts\/249\/revisions"}],"wp:attachment":[{"href":"https:\/\/saemas.com\/sitio_web\/wp-json\/wp\/v2\/media?parent=249"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/saemas.com\/sitio_web\/wp-json\/wp\/v2\/categories?post=249"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/saemas.com\/sitio_web\/wp-json\/wp\/v2\/tags?post=249"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}