Skip to content

Instantly share code, notes, and snippets.

@Tjitse-E
Last active June 7, 2021 14:13
Show Gist options
  • Save Tjitse-E/3354136ab2fd33886d202ab6cbcc1957 to your computer and use it in GitHub Desktop.
Save Tjitse-E/3354136ab2fd33886d202ab6cbcc1957 to your computer and use it in GitHub Desktop.
Mysql 8 update via brew (Magento 2)
# Update all dependencies via brew
brew update
brew upgrade
# validate php
php -v
# When problems re-occur fix them first. I had to run 'brew reinstall icu4c' because my icu4c dependency was missing.
# Remove mysql 5.7
brew services stop mysql@5.7
brew remove mysql@5.7
mv /usr/local/var/mysql /usr/local/var/mysql.backup
mv /usr/local/etc/my.cnf /usr/local/etc/my.cnf.backup
# Install mysql 8
brew install mysql
# Verify mysql 8 installation
mysql -V # Should return v8
netstat -ln | grep mysql # There should be a mysql socket running
mysql
# Set password 'root'
mysql_secure_installation
# Check mysql access
mysql -uroot proot
# Try creating a db for a project using magerun2
n98-magerun2 db:create
# Resulted in an error: SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client
# To fix this checkout https://magento.stackexchange.com/a/318612/28803
# Now retry creating the db.
n98-magerun2 db:import --compression="gzip" your_db.sql.gz
n98-mnagerun2 setup:upgrade
# Validate the frontend
# Fix 'mysql' command on command line
nano /usr/local/etc/my.cnf
# Add:
#
# [client]
# user=root
# password=root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment