📃
tech-diary
  • Overview
  • Kubernetes & OCP
    • Useful Scripts
    • FAQs
  • Docker
    • FAQs
  • Java Development
    • Spring Boot 2 Tips & FAQ
    • Maven Tips & FAQ
    • JDKs and IDEs Tips & FAQ
    • Unit Test Tips & FAQ
  • Go Development
    • Cobra Walkthrough Guide
    • Go Template Walkthrough Guide
    • Logging in Golang
    • Code Walkthrough for Identified OSS Projects
  • Operating Systems
    • RHEL
    • Ubuntu
    • Centos
  • DevOps
    • Git & GitHub Tips
  • Communities
  • RDBMS
    • Contribution Record
    • MySQL
  • Tools
    • VS Code
Powered by GitBook
On this page

Was this helpful?

  1. RDBMS

MySQL

Install MySQL on Mac

Install MySQL v5.7 at Mac with remote access granted:

$ brew install mysql@5.7
$ brew services start mysql@5.7

$ echo 'export PATH="/usr/local/opt/mysql@5.7/bin:$PATH"' >> ~/.zshrc
$ mysql -V
$ mysqladmin -u root password 'Password1'

$ vi /usr/local/etc/my.cnf
---
# Default Homebrew MySQL server config
[mysqld]
# Only allow connections from localhost
#bind-address = 127.0.0.1
bind-address = 0.0.0.0
---

$ brew services restart "mysql@5.7"

$ mysql -u root -p
mysql > use mysql;
mysql > CREATE USER 'myuser'@'%' IDENTIFIED BY 'mypasswd';
mysql > GRANT ALL ON *.* TO 'myuser'@'%';
mysql > flush privileges;

$ brew services stop "mysql@5.7"
PreviousContribution RecordNextVS Code

Last updated 5 years ago

Was this helpful?