Skip to content

Instantly share code, notes, and snippets.

@nabucosound
Created August 15, 2013 00:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nabucosound/6237251 to your computer and use it in GitHub Desktop.
Save nabucosound/6237251 to your computer and use it in GitHub Desktop.
MySQL dirty notes

MySQL

Install MySQL in Mac OS X with Brew

# Install brew install mysql

# Check symlinks to brew binaries in Cellar ls -l /usr/local/bin/mysql_install_db lrwxr-xr-x 1 nabuco staff 43 Apr 4 20:05 /usr/local/bin/mysql_install_db -> ../Cellar/mysql/5.5.10/bin/mysql_install_db

# Set up db and root password unset TMPDIR mysql_install_db mysql.server start mysqladmin -u root password 'mypassword'

# Secure installation and create database mysql_secure_installation mysql -u root -p-e 'create database mydbname character set utf8;'

Dump file size bigger than max default

sudo vim /etc/my.cnf

[mysqld] max_allowed_packet=2000M

mysql.server restart mysql -u root -p --max_allowed_packet=2000M < dbdump.sql

Check storage engine for a database or table

SELECT ENGINE FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME = 'products'

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