Code Bye

Linux下MySQL的数据文件存放在哪里的?

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                       |
+–+–+
在卸载原有数据库,并重新安装之后,原来创建的表居然还在,不知道怎么删除
解决方案

10

rpm安装默认目录:
数据文件:/var/lib/mysql/
配置文件模板:/usr/share/mysql
mysql客户端工具目录:/usr/bin
日志目录:/var/log/
pid,sock文件目录:/tmp/

5

直接rm -rf /var/lib/mysql即可

10

数据库中的表都在这个目录下。
datadir                                 | /var/lib/mysql/

3

还是源码安装方便,自行定义安装目录,数据文件目录……

10

可以直接建立数据库存放目录
dirdata目录

2

show variables like “datadir%”
| datadir                                 | /var/lib/mysql/            |
转移此目录即可。

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明Linux下MySQL的数据文件存放在哪里的?