OMC's Blog

Mysql notes to myself[WIP]

June 26, 2019

Mysql commands

Upgrade

mysql_upgrade
mysql_upgrade --protocol=tcp -P 3306 --user=root --host=127.0.0.1 --skip-version-check --force -uroot -p

Install current mysql version

brew install mysql

Start agent for current version of mysql (including on login)

ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist

Install the different version of mysql

Find older mysql versions

brew search mysql

Install older mysql version

brew install homebrew/versions/mysql@5.7

Start agent for older version of mysql (including on login)

ln -sfv /usr/local/opt/mysql@5.7./*.plist ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql@5.7.plist

Dump mysql

mysqldump --all-databases -uroot > dump.sql

Use dump db

mysql -u username -p -h localhost DATA-BASE-NAME < data.sql
mysql -u root -p
create database mydb;
use mydb;
source db_backup.dump;

Uninstall MySql on a Mac OS X

Uninstall Mysql MacOS

Stopping Background Services with Homebrew


Oguzhan Murat Cakmak, starting his software career in Istanbul and advancing through roles in San Francisco at Uber and Hims&Hers, now does remote work from Kaş, Antalya, balancing his passion for technology with interests in kitesurfing, diving, hiking, and exploring diverse content on podcasts. Follow him on Twitter and Instagram

Webmentions

00
    Loading Webmentions...