Skip to content

Instantly share code, notes, and snippets.

View afriza's full-sized avatar

Afriza N. Arief afriza

  • Indonesia
  • 11:21 (UTC +07:00)
View GitHub Profile
@afriza
afriza / goroutine-id.go
Last active February 22, 2023 05:59 — forked from metafeather/main.go
Get goroutine id for debugging
package main
import (
"fmt"
"runtime"
"strings"
"sync"
)
// Goid gets goroutine ID. Only used for debugging purpose.
@afriza
afriza / HOWTO.md
Created April 13, 2020 04:14 — forked from ivanvermeyen/HOWTO.md
Multiple MySQL versions on MacOS with Homebrew

Multiple MySQL versions on MacOS with Homebrew

At the time of writing (december 2018), there aren’t any up-to-date and easy to apply guides on how to switch between different MySQL version on a Mac using Homebrew . Or at least, I didn’t find any.

So I picked up a few things here and there and finally managed to connect all the pieces of the puzzle. I hope this guide can help you and the future me. If anyone knows of a better way to accomplish this, I do hope they will share their insight :)

The basic idea here is that you need to install all MySQL versions one at a time and assign each its own data directory.

I am using Homebrew 1.8.5. (brew -v)

@afriza
afriza / admin.sql
Last active April 28, 2021 07:41 — forked from Hikingyo/admin.sql
create admin user with all privileges on mysql/mariadb
CREATE USER 'admin'@'localhost' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
## remote connection - not secure
CREATE USER 'admin'@'%' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
# Optional for MySQL 8.0
CREATE USER 'admin'@'localhost' IDENTIFIED WITH mysql_native_password BY 'some_pass';