DBA > Articles

MySQL for Oracle DBAs and Developers

By: Ronald Bradford
To read more DBA articles, visit http://dba.fyicenter.com/article/

MySQL Installation
X OS packages place files in many areas and varies
- e.g. /usr/lib, /var/lib, /var/log, /etc
X Recommend installing using .tar.gz
- Centrally Manageable e.g. /opt/mysql-version
- Upgradeable
- Multiple Versions possible
X $MYSQL_HOME

MySQL Configuration
Multiple MySQL Instances
X my.cnf
- Watch out for /etc/my.cnf, /etc/mysql/my.cnf
- Best Practice $MYSQL_HOME/my.cnf
- --defaults-file=

MySQL Directories
basedir ($MYSQL_HOME)
- e.g. /opt/mysql-5.1.16-beta-linux-i686-glib23
X datadir (defaults to $MYSQL_HOME/data)
X tmpdir (important as mysql behaves unpredictability if full)
X innodb_[...]_home_dir
- mysql> SHOW GLOBAL VARIABLES LIKE '%dir'

MySQL Ports & Sockets
Configured to listen on TCP/IP Port (default 3306)
X Additional Instances
- Different Ports
- Different IP's using default Port
X Local connection uses Socket
- Even specifying Port, local client may use socket

MySQL Log Files
Error Log
- log-error
X Binary Log
- log-bin (my.cnf or mysqld arg)
X Slow Query Log
- log-slow-queries,slow-query-time,log-queries-not-using-indexes
X General Log
- log

MySQL Data Dictionary
mysql Database
- general_log, slow_log (5.1)
mysql> SET GLOBAL GENERAL_LOG=1;
mysql> ...
mysql> SELECT * FROM mysql.general_log;

MySQL Meta Data
INFORMATION_SCHEMA
- TABLES, COLUMNS, VIEWS, USER_PRIVILEGES
- PROCESSLIST (5.1)
- [GLOBAL|SESSION]_[STATUS|VARIABLES] (5.1)

Full article...


Other Related Articles

... to read more DBA articles, visit http://dba.fyicenter.com/article/