1. 程式人生 > >Linux下MySQL的資料檔案存放在哪裡的??

Linux下MySQL的資料檔案存放在哪裡的??

http://bbs.csdn.net/topics/390620630

mysql> show variables like '%dir%';
+-----------------------------------------+----------------------------+
| Variable_name                           | Value                      |
+-----------------------------------------+----------------------------+
| basedir                                 | /usr                       |


| binlog_direct_non_transactional_updates | OFF                        |
| character_sets_dir                      | /usr/share/mysql/charsets/ |
| datadir                                 | /var/lib/mysql/            |
| ignore_db_dirs                          |                            |
| innodb_data_home_dir                    |                            |

| innodb_log_group_home_dir               | ./                         |
| innodb_max_dirty_pages_pct              | 75                         |
| innodb_max_dirty_pages_pct_lwm          | 0                          |
| innodb_undo_directory                   | .                          |
| lc_messages_dir                         | /usr/share/mysql/          |

| plugin_dir                              | /usr/lib/mysql/plugin/     |
| slave_load_tmpdir                       | /tmp                       |
| tmpdir                                  | /tmp                       |
+-----------------------------------------+----------------------------+

資料庫檔案預設在:cd /usr/share/mysql
配置檔案預設在:/etc/my.cnf

———————————–

資料庫目錄:/var/lib/mysql/
配置檔案:/usr/share/mysql(mysql.server命令及配置檔案)
相關命令:/usr/bin(mysqladmin、mysqldump等命令)(*mysql的一種安全啟動方式:/usr/bin/mysqld_safe –user=root &)
啟動指令碼:/etc/rc.d/init.d/

首先你可以使用以下的命令來尋找MySQL
[[email protected] /]# find / -name “mysql” -print
一般來說mysql是放在/usr/local/mysql/下的。
然後在其bin目錄下有個mysql_config檔案,vi之,你會看見這麼一句:
ldata=’/usr/local/mysql/var’


rpm安裝預設目錄:
資料檔案:/var/lib/mysql/
配置檔案模板:/usr/share/mysql
mysql客戶端工具目錄:/usr/bin
日誌目錄:/var/log/
pid,sock檔案目錄:/tmp/