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
[root@stuhome /]# 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/

你可能感兴趣的:(Linux)