Skip to content

Instantly share code, notes, and snippets.

@jayachandraoggy
Forked from alex-79/install_magento2.sh
Created December 5, 2023 07:40
Show Gist options
  • Save jayachandraoggy/6fb2708646e67c2a769030c281bc16d3 to your computer and use it in GitHub Desktop.
Save jayachandraoggy/6fb2708646e67c2a769030c281bc16d3 to your computer and use it in GitHub Desktop.
#!/bin/bash
create_db="CREATE DATABASE $1 CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
create_user="GRANT ALL PRIVILEGES ON $1.* TO '$1'@'localhost' IDENTIFIED BY '$1';"
flush="FLUSH PRIVILEGES;"
mysql -u root -p -e "${create_db}${create_user}${flush}"
mkdir $1.local
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition $1.local
cd $1.local
php bin/magento setup:install --base-url=http://$1.local/ \
--db-host=localhost --db-name=$1 \
--db-user=$1 --db-password=$1 \
--admin-firstname=Magento --admin-lastname=User --admin-email=user@example.com \
--admin-user=admin --admin-password=admin123 --language=en_US \
--currency=UAH --timezone=Europe/Kiev --use-rewrites=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment