The Caboteria / Tech Web / DatabaseTips / MySqlNotes (06 May 2014, TobyCabot)
Small, fast database for simple tasks like providing services to web servers.

People who are concerned about Oracle's actions are moving to MariaDB: https://mariadb.org/

http://dev.mysql.com/doc/

mysql --host=host --user=user -p database

(as root, connected to mysql database) select host, user, password from user;

SHOW VARIABLES LIKE 'version';
show databases;
show tables;
describe table_name;

Debugging "access denied" errors: http://dev.mysql.com/doc/refman/5.1/en/access-denied.html

Character Encoding

http://www.bluebox.net/about/blog/2009/07/mysql_encoding/

Amazon RDS uses latin1 encoding by default, you need to explicitly configure UTF-8: http://matthew.mceachen.us/blog/howto-configure-an-amazon-rds-instance-to-use-utf-8-925.html

mysql> show table status like 'tablename' \G

Note that Ruby's mysql gem doesn't respect the table's encoding, but mysql2 does.

Replication

troubleshooting: http://dev.mysql.com/doc/refman/5.0/en/replication-problems.html
purge binary logs: http://dev.mysql.com/doc/refman/5.0/en/purge-binary-logs.html

show master status;
show slave status \G;

Mac OSX

/Library/StartupItems/MySQLCOM/MySQLCOM

Installs into /usr/local/mysql by default.

Deadlocks

You'll get lots of them: http://dev.mysql.com/doc/refman/5.0/en/innodb-deadlocks.html

Maatkit

http://www.maatkit.org/ - need to look into these tools, they look useful.

OurDelta

An alternative distro with some useful patches applied: http://ourdelta.org/

Edit | Attach | Print version | History: r12 < r11 < r10 < r9 < r8 | Backlinks | Raw View | Raw edit | More topic actions
Copyright © 2008-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding The Caboteria? Send feedback