Skip to content

Instantly share code, notes, and snippets.

@kaanra
Last active January 10, 2020 21:30
Show Gist options
  • Save kaanra/e74a98b2174322dd7859db38b55120a9 to your computer and use it in GitHub Desktop.
Save kaanra/e74a98b2174322dd7859db38b55120a9 to your computer and use it in GitHub Desktop.
[MySQL Terminal Commands] #mysql #terminal

Log into mysql

mysql -u root -p

List databases

SHOW DATABASES;

Current system variable values actually used by the server as it runs

SHOW VARIABLES;

See some statistical and status indicators for a running server

SHOW STATUS;

Import didn't work ERROR 2006 (HY000) at line 1: MySQL server has gone away

https://stackoverflow.com/questions/10474922/error-2006-hy000-mysql-server-has-gone-away

Login to mysql

SET GLOBAL max_allowed_packet=1073741824;

Update my.cnf

https://stackoverflow.com/questions/7973927/for-homebrew-mysql-installs-wheres-my-cnf

Where to find it

sudo /usr/libexec/locate.updatedb
# wait a few minutes for it to finish
locate my.cnf

brew services stop mysql
brew services start mysql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment