mysql启动分析

1、mysql启动配置文件加载路径

/etc/my.cnf/

/etc/mysql/my.cnf

/usr/local/mysql/etc/my.cnf

~/.my.cnf

2、mysql启动方式

service mysqld start

/etc/init.d/mysqld start

说明mysqld来自

cp /usr/local/mysql/support-file/mysql.server  /etc/init.d/mysqld

以下3种方式,可用启动多实例

/usr/local/mysql/bin/mysqld_safe -defaults-file=/path/my.cnf &

/usr/local/mysql/bin/mysqld -defaults-file=/path/my.cnf &

/usr/local/mysql/bin/mysqld_multi start 3306

3、mysql多实例的意义

随着连接数上升,性能下降

做资源隔离

利用mysqld_muti启动管理多实例

准备一个配置文件/etc/my.cnf

[mysql_mutli]

mysqld=

mysqladmin=/usr/local/mysql/bin/mysqladmin

user=

password=

[mysql3306]

port =3306

socket =/tmp/mysql3306.sock

datadir =/data/mysql/mysql3306/data

tmdir =/data/mysql/mysql3306/tmp

server-id=1003306

[mysql3307]

port =3307

socket =/tmp/mysql3307.sock

datadir =/data/mysql/mysql3307/data

tmdir =/data/mysql/mysql3307/tmp

server-id=1003307

时间: 2025-01-02 18:29:01

mysql启动分析的相关文章

Mysql的启动分析

一.Mysql启动配置文件的加载路径 # mysqldump --help| egrep -B2  "/etc/my.cnf" 或者 # mysqld --verbose --help |grep my.cnf Default options are read from the following files in the given order: /etc/my.cnf /etc/mysql/my.cnf /usr/local/mysql/etc/my.cnf ~/.my.cnf -

mysql 启动报错 “mysql-bin.index not found (Errcode: 13)“

安装好mysql数据库后,直接在安装的目录下 /usr/local/mysql  下新建了一个目录data 用于存放数据,建好后,直接去启动数据库,发现启动不了,出现如下报错: mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data /usr/local/mysql/libexec/mysqld: File './mysql-bin.index' not found (Errcode: 13) [E

mysql启动错误排查

今天在Redhat7下面安装MySQL,接下来进行启动MySQL 启动结果如下: [[email protected] log]# service mysqld start Redirecting to /bin/systemctl start mysqld.service Job for mysqld.service failed. See 'systemctl status mysqld.service' and 'journalctl -xn' for details. 那么我们遇到这样的

mysql启动故障(简写)

问题描述和思路 下午做svn钩子文档时,开发大哥跑来,说mysql启动报错,半个小时没找到解决的办法,报错内容为:StartingMySQL. ERROR! The server quit without updating PID file! 根据大哥的描述,马上想到可能是mysql高速运行下,做大量数据查询时候,卡的时候,强制杀掉mysql数据库,由于主主模式不是很熟悉,判断是两边数据写入不一样,导致起不来,马上想到单个服务器启动,进入127服务器,打开my.cnf文件,server-id注销

mysql启动脚本详解

1 #!/bin/sh 2 # Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB 3 # This file is public domain and comes with NO WARRANTY of any kind 4 5 # MySQL daemon start/stop script. 6 7 # Usually this is put in /etc/init.d (at lea

mysql日志分析

由于日志文件是掌握数据库运行状态的重要参考,因此日志文件的维护也有十分重要的意义. mysql的日志类型有二进制日志,错误日志,通用日志,慢查询日志. 模块中添加日志分析log-bin=mysql_bin // 二进制日志log-error=/usr/local/mysql/data/mysql_error.log // 错误日志general_log=ON //开启通用日志general_log_file=/usr/local/mysql/data/mysql_general.log //通用

Mysql元数据分析

https://www.cnblogs.com/Xjng/p/7136424.html 一.information_schema库 information_schema库中的表,保存的是Mysql的元数据. 官网元数据表介绍 InnoDB相关的表介绍 库中有表: +---------------------------------------+ | Tables_in_information_schema | +---------------------------------------+ |

MySQL性能分析之explain

mysql性能分析之explain Explain命令在解决数据库性能上是第一推荐使用命令,大部分的性能问题可以通过此命令来简单的解决,Explain可以用来查看SQL语句的执行效 果,可以帮助选择更好的索引和优化查询语句,写出更好的优化语句. Explain语法:explain select … from … [where …] 例如:explain select * from news; 输出:+--+-----------+-----+----+-------------+---+----

Linux下Mysql启动异常排查方案

遇到Mysql启动异常问题,可以从以下几个方面依次进行问题排查: (1)如果遇到“Can't connect to local MySQL server through socket '/tmp/mysql.sock'”类似问题,查看Mysql配置文件(默认在/etc/my.cnf目录下),使用命令vi /etc/my.cnf,查看是否具备如下配置, [mysqld]port            = 3306socket       = /var/lib/mysql/mysql.sock 可能