Skip to content

Instantly share code, notes, and snippets.

@jonjack
Last active November 15, 2023 11:44
Show Gist options
  • Star 16 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save jonjack/37ce2d0a28fc53d85d7c18de8065d555 to your computer and use it in GitHub Desktop.
Save jonjack/37ce2d0a28fc53d85d7c18de8065d555 to your computer and use it in GitHub Desktop.

Install MySQL

See what formula are available.

brew search mysql
==> Formulae
automysqlbackup              mysql-client                 mysql-connector-c++          mysql-utilities              mysql@5.7
mysql                        mysql-cluster                mysql-sandbox                mysql@5.5                    mysqltuner
mysql++                      mysql-connector-c            mysql-search-replace         mysql@5.6

==> Casks
mysql-connector-python  mysql-shell             mysql-utilities         mysqlworkbench          navicat-for-mysql       sqlpro-for-mysql

Install a version.

brew install mysql@5.7
==> Installing mysql@5.7
==> Downloading https://homebrew.bintray.com/bottles/mysql@5.7-5.7.23.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring mysql@5.7-5.7.23.high_sierra.bottle.tar.gz
==> /usr/local/Cellar/mysql@5.7/5.7.23/bin/mysqld --initialize-insecure --user=jjackson --basedir=/usr/local/Cellar/mysql@5.7/5.7.23 --datadir=/usr

MySQL is configured to only allow connections from localhost by default

To connect run:
    mysql -uroot
    
To have launchd start mysql@5.7 now and restart at login:
  brew services start mysql@5.7
Or, if you don't want/need a background service you can just run:
  /usr/local/opt/mysql@5.7/bin/mysql.server start

MySQL is configured to only allow connections from localhost by default

To connect run:
    mysql -uroot

Install Workbench (Pre-Catalina)

If on Catalina then skip to next section. 👇

brew install --cask mysqlworkbench
==> ==> Downloading https://downloads.mysql.com/archives/get/p/8/file/mysql-workbench-community-8.0.23-macos-x86_64.dmg
######################################################################## 100.0%
==> Verifying checksum for Cask mysqlworkbench
==> Installing Cask mysqlworkbench
==> Moving App 'MySQLWorkbench.app' to '/Applications/MySQLWorkbench.app'.
🍺  mysqlworkbench was successfully installed!

You should see MySQLWorkbench under Applications

Guidelines for Catalina

The current version of mysqlworkbench (8.0.23) for Catalina at time of writing (June 2021) is 8.0.23 which appears to be buggy for certain updates of Catalina. Dropping down one version to 8.0.22 worked for me as follows.

If already installed then remove first.

brew uninstall --cask mysqlworkbench

Download formula for 8.0.22.

wget https://gist.githubusercontent.com/jonjack/de51fb456c7682cbfd55314669d6513c/raw/4b70352469035a2e35818f2c1fff0e1cb1bbec89/mysqlworkbench-8.0.22.rb

Now install.

brew install --cask mysqlworkbench-8.0.22.rb

==> Downloading https://downloads.mysql.com/archives/get/p/8/file/mysql-workbench-community-8.0.22-macos-x86_64.dmg
==> Downloading from https://cdn.mysql.com/archives/mysql-workbench/mysql-workbench-community-8.0.22-macos-x86_64.dmg
######################################################################## 100.0%
==> Installing Cask mysqlworkbench-8.0.22
==> Moving App 'MySQLWorkbench.app' to '/Applications/MySQLWorkbench.app'
🍺  mysqlworkbench-8.0.22 was successfully installed!

Big Sur

There is also a formula here which will install v8.0.25 compatible with Big Sur.

wget https://gist.githubusercontent.com/jonjack/84e24ed5f44e452e629cfe01cf472267/raw/987362b8bd554b49ecc136213321d5f27c89efb0/mysqlworkbench-8.0.25.rb

brew install --cask mysqlworkbench-8.0.25.rb
==> Downloading https://cdn.mysql.com/Downloads/MySQLGUITools/mysql-workbench-community-8.0.25-macos-x86_64.dmg
######################################################################## 100.0%
==> Installing Cask mysqlworkbench-8.0.25
==> Moving App 'MySQLWorkbench.app' to '/Applications/MySQLWorkbench.app'
🍺  mysqlworkbench-8.0.25 was successfully installed!
@savio777
Copy link

savio777 commented Mar 3, 2020

thanks

@marcospojr
Copy link

Thanks

@Devcodpanda
Copy link

Thanks

@clemderome
Copy link

Thanks !

@yosephNoh
Copy link

thanks!

@bioyeneye
Copy link

Thanks 😊

@riapacheco
Copy link

Thank you!

@TheBrown
Copy link

Thank you

@aakanksha-bb
Copy link

aakanksha-bb commented Feb 18, 2021

For me, it's not working.
MySQLWorkbench comes under Applications, after opening it, it says "MySQLWorkbench quit unexpectedly.

log --
`
Process: MySQLWorkbench [64860]
Path: /Applications/MySQLWorkbench.app/Contents/MacOS/MySQLWorkbench
Identifier: com.oracle.workbench.MySQLWorkbench
Version: 8.0.23.CE (1)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: MySQLWorkbench [64860]
User ID: 501

Date/Time: 2021-02-18 09:36:39.120 +0530
OS Version: macOS 11.1 (20C69)
Report Version: 12
Bridge OS Version: 5.1 (18P3030)
Anonymous UUID: F551C371-BBD3-D52F-6EC3-50FB97A14E07

Sleep/Wake UUID: C71F0690-CB95-470A-8ADF-CCE29195939F

Time Awake Since Boot: 36000 seconds
Time Since Wake: 1400 seconds

System Integrity Protection: enabled

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY

Termination Signal: Abort trap: 6
Termination Reason: Namespace SIGNAL, Code 0x6

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff20337792 __abort_with_payload + 10
1 libsystem_kernel.dylib 0x00007fff203391d9 abort_with_payload_wrapper_internal + 80
2 libsystem_kernel.dylib 0x00007fff20339189 abort_with_reason + 19
3 Python3 0x0000000106c83f05 fatal_error.cold.1 + 21
4 Python3 0x0000000106c06f78 fatal_error + 536
5 Python3 0x0000000106c0641a Py_InitializeEx + 138
6 libgrt.dylib 0x0000000103730422 grt::PythonContextHelper::InitPython() + 16
7 libgrt.dylib 0x000000010373065e grt::PythonContext::PythonContext(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) + 412
8 libgrt.dylib 0x0000000103719549 grt::init_python_support(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) + 38
9 libwbpublic.be.dylib 0x0000000103a9171e bec::GRTManager::init_loaders(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, bool) + 28
10 libwbpublic.be.dylib 0x0000000103a916d4 bec::GRTManager::init_module_loaders(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, bool) + 102
11 libwbpublic.be.dylib 0x0000000103a90635 bec::GRTManager::initialize(bool, std::__1::basic_string<char, std::__1::char_traits, std::_1::allocator > const&) + 55
12 libwbprivate.be.dylib 0x00000001043afc55 wb::WBContext::init
(wb::WBFrontendCallbacks*, wb::WBOptions*) + 3517
13 libwbprivate.be.dylib 0x00000001043db4b5 wb::WBContextUI::init(wb::WBFrontendCallbacks*, wb::WBOptions*) + 435
14 com.oracle.workbench.MySQLWorkbench 0x000000010351112a -[WBMainController setupBackend] + 1263
15 com.oracle.workbench.MySQLWorkbench 0x00000001035147b0 -[WBMainController awakeFromNib] + 428
16 com.apple.CoreFoundation 0x00007fff204374c9 -[NSSet makeObjectsPerformSelector:] + 231
17 com.apple.AppKit 0x00007fff22c3ca48 -[NSIBObjectData nibInstantiateWithOwner:options:topLevelObjects:] + 1368
18 com.apple.AppKit 0x00007fff22c31128 loadNib + 392
19 com.apple.AppKit 0x00007fff22c30730 +[NSBundle(NSNibLoading) _loadNibFile:nameTable:options:withZone:ownerBundle:] + 693
20 com.apple.AppKit 0x00007fff22c30386 -[NSBundle(NSNibLoading) loadNibNamed:owner:topLevelObjects:] + 201
21 com.apple.AppKit 0x00007fff22c30164 +[NSBundle(NSNibLoading) loadNibNamed:owner:] + 394
22 com.apple.AppKit 0x00007fff22c22cf8 NSApplicationMain + 566
23 libdyld.dylib 0x00007fff20365621 start + 1
`

@LiamYaoLian
Copy link

LiamYaoLian commented Mar 21, 2021

For me, it's not working.
MySQLWorkbench comes under Applications, after opening it, it says "MySQLWorkbench quit unexpectedly.
...
...
the latest version of workbench has a bug, try https://downloads.mysql.com/archives/workbench/ for version:8.0.21, that will work on your mac

@sangam3101
Copy link

That worked like a charm, thank you!

@OmanyeMensah
Copy link

i am getting issue with starting mysql. i keep getting the below error:
Apples-MacBook-Pro:bin apple$ mysql -uroot
-bash: mysql: command not found

@artodeschini
Copy link

thanks

@newtella
Copy link

Just a small update for Big Sur users.

After executing:
wget https://gist.githubusercontent.com/jonjack/84e24ed5f44e452e629cfe01cf472267/raw/987362b8bd554b49ecc136213321d5f27c89efb0/mysqlworkbench-8.0.25.rb

  1. Open the file and change the url to https://downloads.mysql.com/archives/get/p/8/file/mysql-workbench-community-8.0.25-macos-x86_64.dmg and save it.

  2. Then use brew install mysqlworkbench-8.0.25.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment