MySQL安装介绍
MySQL(Linux)安装目录位置介绍
查看配置文件查询安装目录信息
[root@nwdb ~]# vi /etc/my.cnf # For advice on how to change settings please see # http://dev.mysql.com/doc/refman/5.7/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 70% of total RAM for dedicated server, else 10%. # 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 = mysql-bin server-id = 1 -------Mysql服务的唯一编号 每个mysql服务Id需唯一 # # 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 #log_bin=on #log_bin_basename=/var/lib/mysql/mysql-bin #log_bin_index=/var/lib/mysql/mysql-bin.index datadir=/var/lib/mysql ------数据库和日志文件 socket=/var/lib/mysql/mysql.sock ------设置socke文件所在目录 #skip-grant-tables # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid #log_bin=mysql-bin #log_bin_basename=/var/lib/mysql/mysql-bin #log_bin_index=/var/lib/mysql/mysql-bin.index character-set-server=utf8 lower_case_table_names=1 max_connections=10000 -------允许最大连接数 #default-character-set=utf8
也可以通过如下命令查询安装目录信息
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.000000 | | innodb_max_dirty_pages_pct_lwm | 0.000000 | | innodb_tmpdir | | | innodb_undo_directory | ./ | | lc_messages_dir | /usr/share/mysql/ | | plugin_dir | /usr/lib64/mysql/plugin/ | | slave_load_tmpdir | /tmp | | tmpdir | /tmp | +-----------------------------------------+----------------------------+
数据库目录:/var/lib/mysql/ 配置文件:/usr/share/mysql(mysql.server命令及配置文件) 相关命令:/usr/bin(mysqladmin、mysqldump等命令)(*mysql的一种安全启动方式:/usr/bin/mysqld_safe –user=root &) 启动脚本:/etc/rc.d/init.d/
查看进程相关信息
[root@nwdb sbin]# find / -name mysqladmin /usr/bin/mysqladmin [root@nwdb sbin]# cd /usr/bin/ [root@nwdb bin]# ll |grep mysql -rwxr-xr-x 1 root root 10425671 3月 18 2017 mysql -rwxr-xr-x 1 root root 9325634 3月 18 2017 mysqladmin -rwxr-xr-x 1 root root 11277495 3月 18 2017 mysqlbinlog -rwxr-xr-x 1 root root 9691384 3月 18 2017 mysqlcheck -rwxr-xr-x 1 root root 8319345 3月 18 2017 mysql_config_editor -rwxr-xr-x 1 root root 26518 3月 18 2017 mysqld_multi -rwxr-xr-x 1 root root 28272 3月 18 2017 mysqld_safe -rwxr-xr-x 1 root root 9613387 3月 18 2017 mysqldump -rwxr-xr-x 1 root root 7468 3月 18 2017 mysqldumpslow -rwxr-xr-x 1 root root 9337479 3月 18 2017 mysqlimport -rwxr-xr-x 1 root root 10353177 3月 18 2017 mysql_install_db -rwxr-xr-x 1 root root 5636587 3月 18 2017 mysql_plugin -rwxr-xr-x 1 root root 17587617 3月 18 2017 mysqlpump -rwxr-xr-x 1 root root 9269843 3月 18 2017 mysql_secure_installation -rwxr-xr-x 1 root root 9276892 3月 18 2017 mysqlshow -rwxr-xr-x 1 root root 9390252 3月 18 2017 mysqlslap -rwxr-xr-x 1 root root 5973592 3月 18 2017 mysql_ssl_rsa_setup -rwxr-xr-x 1 root root 5123623 3月 18 2017 mysql_tzinfo_to_sql -rwxr-xr-x 1 root root 12513426 3月 18 2017 mysql_upgrade [root@nwdb bin]# ps -ef|grep mysql root 1877 1 0 May15 ? 00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock --pid-file=/var/run/mysqld/mysqld.pid --basedir=/usr --user=mysql mysql 2131 1877 0 May15 ? 00:07:27 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/lib/mysql/mysql.sock root 16613 26725 0 15:47 pts/0 00:00:00 grep mysql
rpm安装默认目录: 数据文件:/var/lib/mysql/ 配置文件模板:/usr/share/mysql mysql客户端工具目录:/usr/bin 日志目录:/var/log/ pid,sock文件目录:/tmp/