Home > Net >  Why is the error: SQLSTATE[HY000] [335544344] I/O error during "CreateFile (open)" operati
Why is the error: SQLSTATE[HY000] [335544344] I/O error during "CreateFile (open)" operati

Time:12-31

I had such a problem. I can't do the migration. The error is:

SQLSTATE[HY000] [335544344] I/O error during "CreateFile (open)" operation for file "base2".

I am using openserver. Database: firebird Framework: laravel.

I will be glad for any help!

In database wrote:

'firebird' => [
'driver' => 'firebird',
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '3050'),
'database' => env('DB_DATABASE', 'C:\Reports\base2.fdb'),
'username' => env('DB_USERNAME', 'SYSDBA'),
'password' => env('DB_PASSWORD', 'masterkey'),
'charset' => env('DB_CHARSET', 'UTF8'),
'engine_version' => '3.0.0',
]

CodePudding user response:

Someone obviously defined laravel environment variable DB_DATABASE to value 'base2'. Search and destroy!

Otherwise a simpler and better solution is not to use function env() in your code. Using external configuration is convenient sometimes but it opens a door for every king of misconfiguration that are hard to investigate. In the case of PHP it is also a door for hackers.

  • Related