Home  >  Article  >  Database  >  Linux主机下关于MySQL优化的一些体会

Linux主机下关于MySQL优化的一些体会

WBOY
WBOYOriginal
2016-06-07 16:51:391143browse

最近公司的服务器总是有问题,有时候访问慢的受不了,自己对Linux只是刚入门,实在查不出问题,真是把我烦死了。首先想到是否是数

最近公司的服务器总是有问题,有时候访问慢的受不了,,自己对Linux只是刚入门,实在查不出问题,真是把我烦死了。首先想到是否是数据库的问题,想去修改mysql的配置文件,结果到处找不到my.cnf,经过别人指点才知道,要将mysql目录下的mysql-(*).cnf的文件改名为my.cnf拷入到/etc下面,看自己的数据库情况,就把mysql-medium.cnf改名后拷入了,在my.cnf的[mysqld]中加入了mysqldumpslow进行记录mysql的查询慢的语句,结果运行了几天没发现有记录一条下来,晕死,已经将权限之类的都改了,还是不行。

后来一想有无问题是max_connections的问题,在mysql中运行show variables发现max_connections只有100,改为500后重启mysql,这几天似乎没出问题了,希望自己没找错原因。

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn