How to connect to the database at startup via the command line

When I start the zend framework project from the browser, everything is fine, it connects to the database.

When I run the project from the command line, it cannot connect to the database and it gives an error:

Fatal error: throw a "PDOException" exception with the message 'SQLSTATE [HY000] [2002] There is no such file or directory' in /usr/local/zend/share/ZendFramework/library/Zend/Db/Adapter/Pdo/Abstract.php: 129

I used the Zend Framework Action Execution from the command line ( stack overflow

This is my application.ini db part file

 phpSettings.mysql.default_socket=/usr/local/zend/mysql/tmp/mysql.sock resources.db.adapter = "PDO_MYSQL" resources.db.params.host = "localhost" resources.db.params.port = 3306 resources.db.params.username = "root" resources.db.params.password = "root" resources.db.params.dbname = "iteam" resources.db.isDefaultTableAdapter = true resources.db.params.charset = "utf8" 
+11
command-line php zend-framework zend-db
Dec 07 '11 at 11:25
source share
1 answer

Copy the contents of application.ini to the php.ini file, this should work fine.

+1
Dec 07 2018-11-12T00:
source share



All Articles