0
我使用Zend Framework與Doctrine,並且我從本地主機傳輸到我的服務器,但我收到此錯誤。一切都在當地運作良好。與數據庫Doctrine PDO連接
Warning: PDO::__construct() [pdo.--construct]: [2002] No such file or directory
(trying to connect via unix:///tmp/mysql.sock) in /www/webvol19/94/yi8ghefpta7q527/
mywebsite.com/vendor/doctrine/Doctrine/DBAL/Driver/PDOConnection.php on line 36
我的連接設置有這些:
// pdo connection definition
'db' => array(
'driver' => 'Pdo',
'dsn' => 'mysql:dbname=dbname123;host=mysql410.ddd.com',
'username' => 'user',
'password' => 'pass121512',
'driver_options' => array(
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\''
),
),
// doctrine connection definition
'doctrine_config' => array (
'proxy_directory' => APP_PATH
. DIRECTORY_SEPARATOR
. 'data'
. DIRECTORY_SEPARATOR
. 'Doctrineproxy',
'proxy_namespace' => 'Doctrineproxy',
'doctrine_db_conn_params' => array (
'driver' => 'pdo_mysql',
'user' => 'user',
'password' => 'pass121512',
'dbname' => 'dbname123',
),
'is_dev_mode' => true,
),
我不知道這是什麼在我的網站名稱
/www/webvol19/94/yi8ghefpta7q527/
mysql是否在服務器上運行?如果是,它是如何配置的? mysql是監聽本地或外部ip或套接字文件? /tmp/mysql.sock文件是否存在? – edigu
嘗試使用localhost或127.0.0.1之類的東西 –