Newsletter
TechAnV Blog
Get updates on security engineering, Rust, eBPF, and DevSecOps. No spam, unsubscribe anytime.
Check your inbox and click the confirmation link to complete your subscription.
Running a MySQL server using Homebrew#
First, install MySQL like so:
1brew install mysqlThis installs the server but doesn’t run it. You can run it in the background like this:
1% mysql.server start2Starting MySQL3.. SUCCESS!4%Then later on you can stop it like so:
1% mysql.server stop2Shutting down MySQL3. SUCCESS!4%While it’s running it defaults to having a root account that only accepts connections from localhost with no password:
1% mysql -u root2Welcome to the MySQL monitor. Commands end with ; or \g.3Your MySQL connection id is 84...5mysql>Running mysql_secure_installation runs a wizard that helps set up a password.
When you first install it, Homebrew says:
1To have launchd start mysql now and restart at login:2 brew services start mysqlYou can re-display that message by running brew reinstall mysql.
Installing the mysqlclient Python library#
This took me a long time to figure out. Eventually this worked:
1MYSQLCLIENT_CFLAGS=`pkg-config mysqlclient --cflags` \2 MYSQLCLIENT_LDFLAGS=`pkg-config mysqlclient --libs` \3 pip install mysqlclientNewsletter
TechAnV Blog
Get updates on security engineering, Rust, eBPF, and DevSecOps. No spam, unsubscribe anytime.
Check your inbox and click the confirmation link to complete your subscription.