Where is my mysql log?
-bash-3.2$ cat /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0
[mysqld_safe]
log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid
[mysqld]
#bind-address=10.213.220.201
-bash-3.2$
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0
[mysqld_safe]
log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid
[mysqld]
#bind-address=10.213.220.201
-bash-3.2$
Where is my mysql home and all the stuffs ?
[root@mysql ~]# su - mysql
-bash-3.2$ pwd
/var/lib/mysql
-bash-3.2$ pwd
/var/lib/mysql
-bash-3.2$ ls -lrt
total 20560
drwx------ 2 mysql mysql 4096 Jul 16 2013 test
drwx------ 2 mysql mysql 4096 Jul 16 2013 mysql
-rw-rw---- 1 mysql mysql 5242880 Jul 16 2013 ib_logfile1
-rw-rw---- 1 mysql mysql 10485760 Jul 16 2013 ibdata1
srwxrwxrwx 1 mysql mysql 0 Aug 8 08:47 mysql.sock
-rw-rw---- 1 mysql mysql 5242880 Aug 8 08:47 ib_logfile0
find / -name my.cnf
/etc/my.cnf
mysql> SHOW VARIABLES WHERE Variable_Name LIKE "%dir";
+---------------------------+----------------------------+
| Variable_name | Value |
+---------------------------+----------------------------+
| basedir | /usr/ |
| bdb_logdir | |
| bdb_tmpdir | /tmp/ |
| character_sets_dir | /usr/share/mysql/charsets/ |
| datadir | /var/lib/mysql/ |
| innodb_data_home_dir | |
| innodb_log_arch_dir | |
| innodb_log_group_home_dir | ./ |
| plugin_dir | |
| slave_load_tmpdir | /tmp/ |
| tmpdir | /tmp/ |
+---------------------------+----------------------------+
11 rows in set (0.01 sec)
+---------------------------+----------------------------+
| Variable_name | Value |
+---------------------------+----------------------------+
| basedir | /usr/ |
| bdb_logdir | |
| bdb_tmpdir | /tmp/ |
| character_sets_dir | /usr/share/mysql/charsets/ |
| datadir | /var/lib/mysql/ |
| innodb_data_home_dir | |
| innodb_log_arch_dir | |
| innodb_log_group_home_dir | ./ |
| plugin_dir | |
| slave_load_tmpdir | /tmp/ |
| tmpdir | /tmp/ |
+---------------------------+----------------------------+
11 rows in set (0.01 sec)
Or using the one liner command.
mysql -u<<user>> -p -e 'SHOW VARIABLES WHERE Variable_Name LIKE "%dir"'
-bash-3.2$ mysql -uroot -p -e 'SHOW VARIABLES WHERE Variable_Name LIKE "%dir"'
Enter password:
+---------------------------+----------------------------+
| Variable_name | Value |
+---------------------------+----------------------------+
| basedir | /usr/ |
| bdb_logdir | |
| bdb_tmpdir | /tmp/ |
| character_sets_dir | /usr/share/mysql/charsets/ |
| datadir | /var/lib/mysql/ |
| innodb_data_home_dir | |
| innodb_log_arch_dir | |
| innodb_log_group_home_dir | ./ |
| plugin_dir | |
| slave_load_tmpdir | /tmp/ |
| tmpdir | /tmp/ |
+---------------------------+----------------------------+
-bash-3.2$
Enter password:
+---------------------------+----------------------------+
| Variable_name | Value |
+---------------------------+----------------------------+
| basedir | /usr/ |
| bdb_logdir | |
| bdb_tmpdir | /tmp/ |
| character_sets_dir | /usr/share/mysql/charsets/ |
| datadir | /var/lib/mysql/ |
| innodb_data_home_dir | |
| innodb_log_arch_dir | |
| innodb_log_group_home_dir | ./ |
| plugin_dir | |
| slave_load_tmpdir | /tmp/ |
| tmpdir | /tmp/ |
+---------------------------+----------------------------+
-bash-3.2$
mysql> select @@datadir;
+-----------------+
| @@datadir |
+-----------------+
| /var/lib/mysql/ |
+-----------------+
1 row in set (0.00 sec)
+-----------------+
| @@datadir |
+-----------------+
| /var/lib/mysql/ |
+-----------------+
1 row in set (0.00 sec)
show variables to look at the whole thing.
show variables;
-bash-3.2$ mysql -uroot -p -e "show variables" | grep "port"
Enter password:
innodb_support_xa ON
large_files_support ON
port 3306
-bash-3.2$
Enter password:
innodb_support_xa ON
large_files_support ON
port 3306
-bash-3.2$
-bash-3.2$ locate mysqldump
/usr/bin/mysqldump
/usr/bin/mysqldumpslow
/usr/share/man/man1/mysqldump.1.gz
/usr/share/man/man1/mysqldumpslow.1.gz
-bash-3.2$
/usr/bin/mysqldump
/usr/bin/mysqldumpslow
/usr/share/man/man1/mysqldump.1.gz
/usr/share/man/man1/mysqldumpslow.1.gz
-bash-3.2$
All other mysql utilities are here.
-bash-3.2$ pwd; ls -lrt my*
/usr/bin
-rwxr-xr-x 1 root root 3888 Jan 8 2013 mysql_zap
-rwxr-xr-x 1 root root 5753 Jan 8 2013 mysql_upgrade_shell
-rwxr-xr-x 1 root root 15192 Jan 8 2013 mysql_tableinfo
-rwxr-xr-x 1 root root 17471 Jan 8 2013 mysql_setpermission
-rwxr-xr-x 1 root root 7760 Jan 8 2013 mysql_secure_installation
-rwxr-xr-x 1 root root 13659 Jan 8 2013 mysql_install_db
-rwxr-xr-x 1 root root 32268 Jan 8 2013 mysqlhotcopy
-rwxr-xr-x 1 root root 5834 Jan 8 2013 mysql_fix_privilege_tables
-rwxr-xr-x 1 root root 1261 Jan 8 2013 mysql_fix_extensions
-rwxr-xr-x 1 root root 3315 Jan 8 2013 mysql_find_rows
-rwxr-xr-x 1 root root 11648 Jan 8 2013 mysql_explain_log
-rwxr-xr-x 1 root root 7140 Jan 8 2013 mysqldumpslow
-rwxr-xr-x 1 root root 14108 Jan 8 2013 mysqld_safe
-rwxr-xr-x 1 root root 23845 Jan 8 2013 mysqld_multi
-rwxr-xr-x 1 root root 3670 Jan 8 2013 mysql_convert_table_format
-rwxr-xr-x 1 root root 111560 Jan 8 2013 mysqlaccess
-rwxr-xr-x 1 root root 112520 Jan 8 2013 mysql_waitpid
-rwxr-xr-x 1 root root 57768 Jan 8 2013 mysql_upgrade
-rwxr-xr-x 1 root root 1312408 Jan 8 2013 mysql_tzinfo_to_sql
-rwxr-xr-x 1 root root 13544 Jan 8 2013 mysqltestmanager-pwgen
-rwxr-xr-x 1 root root 15464 Jan 8 2013 mysqltestmanagerc
-rwxr-xr-x 1 root root 42464 Jan 8 2013 mysqltestmanager
-rwxr-xr-x 1 root root 157448 Jan 8 2013 mysqltest
-rwxr-xr-x 1 root root 28224 Jan 8 2013 mysqlshow
-rwxr-xr-x 1 root root 26112 Jan 8 2013 mysqlimport
-rwxr-xr-x 1 root root 75264 Jan 8 2013 mysqldump
-rwxr-xr-x 1 root root 7632 Jan 8 2013 mysql_config
-rwxr-xr-x 1 root root 30400 Jan 8 2013 mysqlcheck
-rwxr-xr-x 1 root root 7632 Jan 8 2013 mysqlbug
-rwxr-xr-x 1 root root 113168 Jan 8 2013 mysqlbinlog
-rwxr-xr-x 1 root root 35136 Jan 8 2013 mysqladmin
-rwxr-xr-x 1 root root 314680 Jan 8 2013 mysql
-rwxr-xr-x 1 root root 1331800 Jan 8 2013 my_print_defaults
-rwxr-xr-x 1 root root 1596336 Jan 8 2013 myisampack
-rwxr-xr-x 1 root root 1568864 Jan 8 2013 myisamlog
-rwxr-xr-x 1 root root 1563336 Jan 8 2013 myisam_ftdump
-rwxr-xr-x 1 root root 1682400 Jan 8 2013 myisamchk
/usr/bin
-rwxr-xr-x 1 root root 3888 Jan 8 2013 mysql_zap
-rwxr-xr-x 1 root root 5753 Jan 8 2013 mysql_upgrade_shell
-rwxr-xr-x 1 root root 15192 Jan 8 2013 mysql_tableinfo
-rwxr-xr-x 1 root root 17471 Jan 8 2013 mysql_setpermission
-rwxr-xr-x 1 root root 7760 Jan 8 2013 mysql_secure_installation
-rwxr-xr-x 1 root root 13659 Jan 8 2013 mysql_install_db
-rwxr-xr-x 1 root root 32268 Jan 8 2013 mysqlhotcopy
-rwxr-xr-x 1 root root 5834 Jan 8 2013 mysql_fix_privilege_tables
-rwxr-xr-x 1 root root 1261 Jan 8 2013 mysql_fix_extensions
-rwxr-xr-x 1 root root 3315 Jan 8 2013 mysql_find_rows
-rwxr-xr-x 1 root root 11648 Jan 8 2013 mysql_explain_log
-rwxr-xr-x 1 root root 7140 Jan 8 2013 mysqldumpslow
-rwxr-xr-x 1 root root 14108 Jan 8 2013 mysqld_safe
-rwxr-xr-x 1 root root 23845 Jan 8 2013 mysqld_multi
-rwxr-xr-x 1 root root 3670 Jan 8 2013 mysql_convert_table_format
-rwxr-xr-x 1 root root 111560 Jan 8 2013 mysqlaccess
-rwxr-xr-x 1 root root 112520 Jan 8 2013 mysql_waitpid
-rwxr-xr-x 1 root root 57768 Jan 8 2013 mysql_upgrade
-rwxr-xr-x 1 root root 1312408 Jan 8 2013 mysql_tzinfo_to_sql
-rwxr-xr-x 1 root root 13544 Jan 8 2013 mysqltestmanager-pwgen
-rwxr-xr-x 1 root root 15464 Jan 8 2013 mysqltestmanagerc
-rwxr-xr-x 1 root root 42464 Jan 8 2013 mysqltestmanager
-rwxr-xr-x 1 root root 157448 Jan 8 2013 mysqltest
-rwxr-xr-x 1 root root 28224 Jan 8 2013 mysqlshow
-rwxr-xr-x 1 root root 26112 Jan 8 2013 mysqlimport
-rwxr-xr-x 1 root root 75264 Jan 8 2013 mysqldump
-rwxr-xr-x 1 root root 7632 Jan 8 2013 mysql_config
-rwxr-xr-x 1 root root 30400 Jan 8 2013 mysqlcheck
-rwxr-xr-x 1 root root 7632 Jan 8 2013 mysqlbug
-rwxr-xr-x 1 root root 113168 Jan 8 2013 mysqlbinlog
-rwxr-xr-x 1 root root 35136 Jan 8 2013 mysqladmin
-rwxr-xr-x 1 root root 314680 Jan 8 2013 mysql
-rwxr-xr-x 1 root root 1331800 Jan 8 2013 my_print_defaults
-rwxr-xr-x 1 root root 1596336 Jan 8 2013 myisampack
-rwxr-xr-x 1 root root 1568864 Jan 8 2013 myisamlog
-rwxr-xr-x 1 root root 1563336 Jan 8 2013 myisam_ftdump
-rwxr-xr-x 1 root root 1682400 Jan 8 2013 myisamchk
No comments:
Post a Comment