1.简单查看路径

1.查看数据库的存放路径

进入mysql终端
mysql>show variables like '%datadir%';

2.查看文件安装路径

[root@hadoop01 etc]# whereis mysql
mysql: /usr/bin/mysql /usr/lib64/mysql /usr/share/mysql /usr/share/man/man1/mysql..gz

安装了mysql,但是不知道文件都安装在哪些地方、放在哪些文件夹里,可以用下面的命令查看所有的文件路径  whereis

然后我们依次访问上面四个文件夹和文件:

[root@hadoop01 ~]# cd /usr/bin/mysql
-bash: cd: /usr/bin/mysql: Not a directory
[root@hadoop01 ~]# more /usr/bin/mysql
******** /usr/bin/mysql: Not a text file ******** [root@hadoop01 ~]# cd /usr/lib64/mysql
[root@hadoop01 mysql]# ll
total
lrwxrwxrwx root root Oct : libmysqlclient_r.so. -> libmysqlclient.so.
lrwxrwxrwx root root Oct : libmysqlclient_r.so.18.1. -> libmysqlclient.so.18.1.
lrwxrwxrwx root root Oct : libmysqlclient.so. -> libmysqlclient.so.18.1.
-rwxr-xr-x root root Sep libmysqlclient.so.18.1.
drwxr-xr-x. root root Oct : plugin [root@hadoop01 mysql]# cd /usr/share/mysql
[root@hadoop01 mysql]# ll
total
drwxr-xr-x root root Oct : bulgarian
drwxr-xr-x. root root Oct : charsets
drwxr-xr-x. root root Oct : czech
drwxr-xr-x. root root Oct : danish
-rw-r--r-- root root Sep dictionary.txt
drwxr-xr-x. root root Oct : dutch
drwxr-xr-x. root root Oct : english
-rw-r--r-- root root Sep errmsg-utf8.txt
drwxr-xr-x. root root Oct : estonian
-rw-r--r-- root root Sep fill_help_tables.sql
drwxr-xr-x. root root Oct : french
drwxr-xr-x. root root Oct : german
drwxr-xr-x. root root Oct : greek
drwxr-xr-x. root root Oct : hungarian
-rw-r--r-- root root Sep innodb_memcached_config.sql
drwxr-xr-x. root root Oct : italian
drwxr-xr-x. root root Oct : japanese
drwxr-xr-x. root root Oct : korean
-rw-r--r-- root root Sep magic
-rw-r--r-- root root Sep my-default.cnf
-rw-r--r-- root root Sep mysql-log-rotate
-rw-r--r-- root root Sep mysql_security_commands.sql
-rw-r--r-- root root Sep mysql_system_tables_data.sql
-rw-r--r-- root root Sep mysql_system_tables.sql
-rw-r--r-- root root Sep mysql_test_data_timezone.sql
drwxr-xr-x. root root Oct : norwegian
drwxr-xr-x. root root Oct : norwegian-ny
drwxr-xr-x. root root Oct : polish
drwxr-xr-x. root root Oct : portuguese
drwxr-xr-x. root root Oct : romanian
drwxr-xr-x. root root Oct : russian
drwxr-xr-x root root Oct : SELinux
drwxr-xr-x. root root Oct : serbian
drwxr-xr-x. root root Oct : slovak
drwxr-xr-x. root root Oct : spanish
drwxr-xr-x. root root Oct : swedish
drwxr-xr-x. root root Oct : ukrainian [root@hadoop01 ~]# cd /usr/share/man/man1/mysql..gz
-bash: cd: /usr/share/man/man1/mysql..gz: Not a directory

四个安装文件和文件夹

3.询运行文件所在路径(文件夹地址)

只要查询文件的运行文件所在地址,直接用下面的命令

2.Linux下查看mysql是否安装,以及安装路径。

[root@hadoop01 mysql]#  ps -ef|grep mysql
mysql : ? :: /bin/sh /usr/bin/mysqld_safe --basedir=/usr
mysql : ? :: /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/lib/mysql/mysql.sock
root : tty1 :: mysql -uroot -px xx
root : pts/ :: mysql -uroot -px xx
root : pts/ :: grep --color=auto mysql
我们单独拿出来讲一下:
/usr/sbin/mysqld 

--basedir=/usr
#文件存放目录
--datadir=/var/lib/mysql
#mysql插件安装地址
--plugin-dir=/usr/lib64/mysql/plugin
#错误日志
--log-error=/var/log/mysqld.log
#mysql进程id
--pid-file=/var/run/mysqld/mysqld.pid
#文件是负责mysql的连接的,如果该文件不存在,则无法访问mysql
--socket=/var/lib/mysql/mysql.sock

那么做这些参数怎么来的?他是由/etc/my.conf 配置文件控制的

/etc/my.cnf
[root@hadoop01 etc]# cat /etc/my.cnf
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
[mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at % of total RAM for dedicated server, else %.
# innodb_buffer_pool_size = 128M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock # Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links= # Recommended in standard MySQL setup
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES [mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

mysql的数据库存放的路径以及安装路径的更多相关文章

  1. mysql数据库存放的路径以及安装路径

    mysql数据库存放的路径以及安装路径 1.查看mysql的存放路径 1.查看数据库的存放路径 进入mysql终端 mysql>show variables like '%datadir%'; ...

  2. Linux 下mysql修改数据库存放目录方法和可能遇到的问题

    MySQL版本:5.6.23-enterprise-commercial-advanced ,使用rpm安装linux:Red Hat Enterprise Linux Server release ...

  3. Mysql初识数据库《一》下载安装Mysql

    #1.下载:MySQL Community Server 5.7.16 http://dev.mysql.com/downloads/mysql/ #2.解压 如果想要让MySQL安装在指定目录,那么 ...

  4. MySQL查看数据库安装路径

    有时候在我们开发的过程中并不一定记得数据库的安装路径.比如要查看mysql 数据库的安装目录在哪里:我们可以通过mysql命令查看mysql的安装路径: # 以下两个sql任意一个可查询 select ...

  5. Linux下查看MySQL的安装路径

    Linux下查看mysql.apache是否安装,并卸载. 指令 ps -ef|grep mysql 得出结果 root               ?        :: /bin/sh /usr/ ...

  6. Python3.7和数据库MySQL 8.0.12 绿色解压 安装教程(一)

    首先要安装MySQL 数据库才可以继续安装图形工具SQLyog 第一步:下载解压包>> MYSQL官网地址:https://dev.mysql.com/downloads/file/?id ...

  7. Linux下查看nginx、mysql、php的安装路径和编译参数

    一:查看安装路径: 1.nginx安装路径: ps  -ef | grep nginx 摁回车,将出现如下图片: master process 后面的就是 nginx的目录. 2.mysql安装路径: ...

  8. CentOS下查看MySQL的安装路径

    Linux下查看mysql.apache是否安装,并卸载. 指令 ps -ef|grep mysql 得出结果 root     17659     1  0  2011 ?        00:00 ...

  9. MYSQL之数据库初识、安装详解、sql语句基本操作

    目录 MYSQL之数据库初识及安装详解 1.什么是数据库? 1.什么是数据?(data) 2.什么是数据库?(databases,简称DB) 2.为什要用数据库? 3.什么是数据库管理系统?(Data ...

随机推荐

  1. Lua字符串及模式匹配

    字符类基础函数举例介绍: string.len( ‘string’ ) string.lower( ‘string’ ) string.upper( ‘string’ ) string.rep( ‘a ...

  2. vultr 更换服务器

    今天打算去p站看看电影 结果发现自己的vps被封了......记录一下换服务器的过程 首先去 https://www.17ce.com/ ping一下,发现只有国外的服务器能ping通 果然是被封了. ...

  3. Linux就该这么学——初识vim编辑器

    在Linux系统中一切都是文件,而配置一个服务就是在修改其配置文件的参数 初识Vim编辑器 Vim编辑器顾名思义就是用来编写脚本程序的”记事本” Vim编辑器模式 : 命令模式 : 控制光标移动,可对 ...

  4. tr、od命令

    一.tr:替换或删除字符 语法:       tr [OPTION] ... SET1 [SET2] 描述       翻译,压缩和/或删除标准输入中的字符,可写吗?       到标准输出. -c, ...

  5. springboot打包的jar项目,不需要安装jdk环境启动

    因为服务器上是JDK7,而springboot至少用JDK8才行,但是又因为是很老的项目,不是很清楚能不能换JDK8,有风险,因此选择以前项目用JDK7,而新的springboot用JDK8.步骤一: ...

  6. lua的数据类型

    Lua 是动态(弱)类型的语言,它有一下几种数据结构: nil(空) nil 类型表示一种没有任何有效值,它只有一个值 -- nil,例如打印一个没有赋值的变量,便会输出一个 nil 值: print ...

  7. 6.Bash的功能

    6.Bash的功能本章介绍 Bash 的特色功能.6.1 Bash的启动 bash [长选项] [-ir] [-abefhkmnptuvxdBCDHP] [-o 选项] [-O shopt 选项] [ ...

  8. Struts的相关基础

    为什么要用struts? 1.该框架基予mvc的开发设计模式上的,所以拥有mvc的全部优点,他在M.V.C上都有涉及,但它主要是提供一个好的控制器和一套定制的标签库上,有mvc的一系列优点:层次分明, ...

  9. LeetCode 腾讯精选50题--有效的括号

    根据题意,第一反应就是使用栈,左右括号相匹配,则将左括号出栈,否则将左括号入栈. 这里我用数组配合“指针”模拟栈的入栈与出栈操作,初始时指针位置指向0,表示空栈,凡遇上左括号则直接入栈,若遇上有括号, ...

  10. sass之mixin的全局引入(vue3.0)

    sass之mixin的全局引入(vue3.0) 1.scss文件(mixin.scss) /* 渐变 */ @mixin gradual($color, $color1){ background: $ ...