<?php
/* This file is part of EC-CUBE
* Copyright(c) LOCKON CO.,LTD. All Rights Reserved.
* http://www.lockon.co.jp/
* For the full copyright and license information, please view the LICENSE file that was distributed with this source code.
*/
namespace Eccube\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
class MailCommand extends Command
{
protected static $defaultName = 'eccube:mail';
/** * @var SymfonyStyle */ protected $io; public function __construct(\Swift_Mailer $mailer) { parent::__construct(); $this->mailer = $mailer; }protected function configure() { $this->setDescription('メールのテスト'); }protected function initialize(InputInterface $input, OutputInterface $output) { $this->io = new SymfonyStyle($input, $output); }protected function execute(InputInterface $input, OutputInterface $output) { $message = (new \Swift_Message()) ->setSubject('メール送信チェック') ->setFrom('test01@example.com') ->setTo('test02@example.com') ->setBcc('test03@example.com') ->setReplyTo('test04@example.com') ->setReturnPath('test05@example.com'); $this->mailer->send($message); $this->io->success('メール送信テスト完了.'); }
}
An exception occurred in driver: SQLSTATE[HY000] [1044] Access denied for user 'dbuser'@'%' to database データベース名
ではSQLで確認しましょう
DockerのコンテナへSQL接続
意味が違かったらすみません。
Dockerの下記画面で、黄色の枠のCLIを押せばコンテナのコマンドライン?が起動します。
コマンドラインからmysqlに接続
mysql -u root -p
デフォルトのパスワードは:root
sqlで権限確認
SHOW GRANTS FOR `dbuser`@`%`;
結果
+------------------------------------------------------+
| Grants for dbuser@% |
+------------------------------------------------------+
| GRANT USAGE ON *.* TO 'dbuser'@'%' |
| GRANT ALL PRIVILEGES ON `eccubedb`.* TO 'dbuser'@'%' |
+------------------------------------------------------+
2 rows in set (0.00 sec)
> bin/console doctrine:schema:create
! [CAUTION] This operation should not be executed in a production environment!
Creating database schema...
[OK] Database schema created successfully!
> bin/console eccube:fixtures:load
> Finished Successful!
In AbstractMySQLDriver.php line 93:
An exception occurred in driver: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 6291464 bytes) in /var/www/html/vendor/easycorp/easy-log-handler/src/EasyLogFormatter.php on line 84