こちらのページを参考にしました。
EC-CUBE 4.0 開発者向けドキュメント:インストール方法
こちらのページのように、sqlite3 でインストールして動作の確認をし、MariaDB に切り替えます。
eccube-4.2.1 を symfony/cli でインストール (sqlite3)
Ubuntu 22.10 で確認しました。
データベースの用意
ホスト localhost
ユーザー dbuser
パスワード secret
データベース eccubedb
SQL
create user 'dbuser'@'localhost' identified by 'secret';
create database eccubedb;
grant all on eccubedb.* to 'dbuser'@'localhost';
インターアクティブに作成
$ sudo mysql -uroot
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 32
Server version: 10.6.12-MariaDB-0ubuntu0.22.10.1 Ubuntu 22.10
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> create user 'dbuser'@'localhost' identified by 'secret';
Query OK, 0 rows affected (0.004 sec)
MariaDB [(none)]> create database eccubedb;
Query OK, 1 row affected (0.000 sec)
MariaDB [(none)]> grant all on eccubedb.* to 'dbuser'@'localhost';
Query OK, 0 rows affected (0.004 sec)
MariaDB [(none)]> exit
Bye
インストール
bin/console eccube:install
次のように入れます。
Trusted hosts. ex) www.example.com, localhost ...etc [localhost]:
> localhost
Database Url [mysql://dbuser:secret@localhost/eccubedb]:
> mysql://dbuser:secret@localhost/eccubedb
Mailer Dsn [null://null]:
> null://null
Auth Magic [qaMx5l1c1k1VrH2U]:
> qaMx5l1c1k1VrH2U
.env が次のように書き換えられます。
.env
(省略)
DATABASE_URL=mysql://dbuser:secret@localhost/eccubedb
DATABASE_SERVER_VERSION=10.6.12-MariaDB-0ubuntu0.22.10.1
DATABASE_CHARSET=utf8mb4
(省略)
サーバーの起動
symfony server:start
フロント画面
管理画面
http://localhost:8000/admin/
ユーザー admin
パスワード password
でログイン
DB サーバー: MySQL 10.6.12-MariaDB-0ubuntu0.22.10.1