2 回答
TA贡献1876条经验 获得超6个赞
'driver' => 'mysql',
'host' => env('DB_HOST', ''),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', ''),
'username' => env('DB_USERNAME', ''),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_0900_ai_ci',
'prefix' => '',
'strict' => false,
'engine' => null,
'option' => [
PDO::MYSQL_ATTR_SSL_CA => base_path('/var/mysql-cert/dbname_cm-db.pem')
],
],```
have you already try file this part `'username' => env('DB_USERNAME', ''),` with `'username' => env('DB_USERNAME', 'cmadmin'),`
and of course the DB_PASSWORD part with your predefined password
TA贡献1825条经验 获得超6个赞
我通过在 database.php 文件中添加以下代码解决了这个问题
'mysql' = [
'sslmode' => 'require',
'options' => array(
PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT => false,
PDO::MYSQL_ATTR_SSL_KEY => '/certs/client-key.pem',
PDO::MYSQL_ATTR_SSL_CERT => '/certs/client-cert.pem',
PDO::MYSQL_ATTR_SSL_CA => '/certs/ca.pem',
)
],
- 2 回答
- 0 关注
- 226 浏览
添加回答
举报