Skip to content

Instantly share code, notes, and snippets.

@iamdylanngo
Last active March 7, 2020 06:59
Show Gist options
  • Save iamdylanngo/cf32a5c05a0396b6efffadf5e9426ba5 to your computer and use it in GitHub Desktop.
Save iamdylanngo/cf32a5c05a0396b6efffadf5e9426ba5 to your computer and use it in GitHub Desktop.
install magento2.x, nginx, mariadb
// Create database and grant permission
CREATE DATABASE m234;
CREATE USER 'm234'@'localhost' IDENTIFIED BY '123456';
GRANT ALL ON m234.* to 'm234'@'localhost' IDENTIFIED BY '123456' WITH GRANT OPTION;
FLUSH PRIVILEGES;
EXIT;
// Install magento with command
bin/magento setup:install \
--backend-frontname=admin \
--db-host=localhost \
--db-name=m234 \
--db-user=m234 \
--db-password=123456AA \
--base-url=http://m234.local/ \
--admin-firstname=Admin \
--admin-lastname=Admin \
[email protected] \
--admin-user=admin \
--admin-password=123456 \
--language=en_US \
--currency=USD \
--timezone=America/New_York \
--use-rewrites=1
// Fix permission
sudo find -type f -exec chmod 640 {} \; && sudo find -type d -exec chmod 750 {} \;
// Fix own
sudo adduser www-data $USER
// Change session: Save files to DB
app/etc/env.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment