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. return [
  16. // 默认数据库
  17. 'default' => 'mysql',
  18. // 各种数据库配置
  19. 'connections' => [
  20. 'mysql' => [
  21. 'driver' => 'mysql',
  22. 'host' => getenv('DB_HOST'),
  23. 'port' => getenv('DB_PORT'),
  24. 'database' => getenv('DB_DATABASE'),
  25. 'username' => getenv('DB_USERNAME'),
  26. 'password' => getenv('DB_PASSWORD'),
  27. 'unix_socket' => '',
  28. 'charset' => 'utf8',
  29. 'collation' => 'utf8_unicode_ci',
  30. 'prefix' => '',
  31. 'strict' => true,
  32. 'engine' => null,
  33. ]
  34. ]
  35. ];