database.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * This file is part of webman.
  4. *
  5. * Licensed under The MIT License
  6. * For full copyright and license information, please see the MIT-LICENSE.txt
  7. * Redistributions of files must retain the above copyright notice.
  8. *
  9. * @author walkor<walkor@workerman.net>
  10. * @copyright walkor<walkor@workerman.net>
  11. * @link http://www.workerman.net/
  12. * @license http://www.opensource.org/licenses/mit-license.php MIT License
  13. */
  14. return [
  15. // 默认数据库
  16. 'default' => 'mysql',
  17. // 各种数据库配置
  18. 'connections' => [
  19. 'mysql' => [
  20. 'driver' => 'mysql',
  21. 'host' => getenv('DB_HOST'),
  22. 'port' => getenv('DB_PORT'),
  23. 'database' => getenv('DB_DATABASE'),
  24. 'username' => getenv('DB_USERNAME'),
  25. 'password' => getenv('DB_PASSWORD'),
  26. 'unix_socket' => '',
  27. 'charset' => getenv('DB_CHARSET'),
  28. 'collation' => getenv('DB_COLLATION'),
  29. 'prefix' => '',
  30. 'strict' => true,
  31. 'engine' => null,
  32. ],
  33. ],
  34. ];