配置文件中有一个datadir参数, 该参数制定了数据库所在的路径
-
mysql> show variables like 'datadir'\G
-
*************************** 1. row ***************************
-
Variable_name: datadir
-
Value: /var/lib/mysql/
-
1 row in set (0.00 sec)
-
-
mysql> system ls -lh /var/lib/mysql/data
-
ls: 无法访问 /var/lib/mysql/data: 权限不够
-
mysql>
查看配置文件:
- [mysqld]
-
#
-
# * Basic Settings
-
#
-
-
#
-
# * IMPORTANT
-
# If you make changes to these settings and your system uses apparmor, you may
-
# also need to also adjust /etc/apparmor.d/usr.sbin.mysqld.
-
#
-
-
user = mysql
-
socket = /var/run/mysqld/mysqld.sock
-
port = 3306
-
basedir = /usr
-
datadir = /var/lib/mysql
-
tmpdir = /tmp
-
skip-external-locking
- keke@keke-VirtualBox ~ $ sudo ls -lh /var/lib/mysql/
-
总计 21M
-
-rw-r--r-- 1 root root 0 2011-03-04 10:55 debian-5.1.flag
-
-rw-rw---- 1 mysql mysql 10M 2011-03-14 10:22 ibdata1
-
-rw-rw---- 1 mysql mysql 5.0M 2011-03-17 15:55 ib_logfile0
-
-rw-rw---- 1 mysql mysql 5.0M 2011-03-04 10:55 ib_logfile1
-
-rw-rw---- 1 mysql mysql 5 2011-03-17 15:55 keke-VirtualBox.pid
-
drwx------ 2 mysql root 4.0K 2011-03-04 10:55 mysql
-
-rw-rw---- 1 root root 6 2011-03-04 10:55 mysql_upgrade_info
-
drwx------ 2 mysql mysql 4.0K 2011-03-09 17:47 phpmyadmin
-
drwx------ 2 mysql mysql 4.0K 2011-03-04 11:20 test
阅读(1738) | 评论(0) | 转发(0) |