我的服务器只有一个站点和一个数据库。然而,我无法调整它以使负载恢复正常。
如果我重新启动 mysql 服务,内存和负载会下降到正常,但几天后,内存和负载会逐渐增加。
mysql Ver 14.14 Distrib 5.7.28, for Linux (x86_64) using EditLine wrapper
# 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 …Run Code Online (Sandbox Code Playgroud) 我应该为自己感到羞耻,因为我知道。
查看附件中的此屏幕截图。 
我的服务器确实没有看到大量的流量,不应该超载。Mysql 正在举办一个派对,邀请了所有人。问题是我不喜欢这种狂野的派对。
我怎么杀这个东西?我如何对其进行监管以使其不会继续发生?很快,我的主人就会报警,所有人的聚会都将结束。
我想将配置文件路径从 更改C:\为E:\,但找不到执行此操作的方法。
或者,有没有办法用我想要的配置文件启动一个新实例?我做过类似的事情,mysqld --init-file="E:\db\my.ini"但效果不佳。
--编辑--
我用配置文件启动了新实例,它运行良好,但我遇到了另一个问题。你能帮我解决这个问题吗?
https://dba.stackexchange.com/questions/100492/cannot-change-datadir-for-mysqld
如果可能,我想知道如何显示(使用命令行)my.ini服务器使用的路径。
我在 Windows IIS 中使用 MySQL 5.6。
我有以下几点:
Program Files\MySQL\MySQL Server 5.6\my-default.iniC:\ProgramData\MySQL\MySQL Server 5.6\my.ini.当然,服务器正在使用第二个。路径是否存储在 mysql 服务器变量内的任何变量中?我正在检查一些系统变量,但找不到。
有任何想法吗?
更新罗纳尔多的帖子后,我运行了一个 --help ,这是我发现的:
...
Default options are read from the following files in the given order:
C:\Windows\my.ini
C:\Windows\my.cnf
C:\my.ini
C:\my.cnf
C:\Program Files\MySQL\MySQL Server 5.6\my.ini
C:\Program Files\MySQL\MySQL Server 5.6\my.cnf
The following groups are read: mysql client
The following options may be given as the first argument:
--print-defaults Print the program argument list and exit.
...
Run Code Online (Sandbox Code Playgroud)
奇怪的是我没有这些文件。我坐下来显示每个文件夹上的隐藏文件。
所以,我看了一下这篇 …
我正在 Fedora 22 上全新安装 MySQL。运行 mysql_install_db 后,我尝试使用 mysqld_safe 启动守护进程,但它不起作用。系统说:
mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended
Run Code Online (Sandbox Code Playgroud)
我该如何让它发挥作用?
以下是 mariadb.log 内容:
mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
[Note] /usr/libexec/mysqld (mysqld 10.0.23-MariaDB) starting as process 20443 ...
[Note] InnoDB: Using mutexes to ref count buffer pool pages
[Note] InnoDB: The InnoDB memory heap is disabled
[Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
[Note] InnoDB: Memory barrier …Run Code Online (Sandbox Code Playgroud) 如果我运行mysqld,即直接在命令行上调用它,它会在外壳关闭或点击 时幸存下来ctrl-c。
有没有办法“交互式”运行它,即如果发生这些事情中的任何一个,它就会关闭?
(我发现这在开发过程中很有用,因为我有一个 tmux 脚本可以快速启动和关闭各种服务器。)
我正在使用 MySQL 版本 5.5.44 运行 Ubuntu
mysqld Ver 5.5.44-0ubuntu0.14.10.1 for debian-linux-gnu on x86_64 ((Ubuntu))
我有一个带外键的数据库。我希望在系统级别(而不是在会话中)禁用外键检查。
我看到系统 var foreign_key_checks似乎控制了这种行为,但是当我/etc/mysql/my.cnf(通过添加foreign_key_checks = 0)设置它时,服务器将无法启动。错误日志如下所示:
150729 15:38:18 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
150729 15:38:18 [Note] Plugin 'FEDERATED' is disabled.
150729 15:38:18 InnoDB: The InnoDB memory heap is disabled
150729 15:38:18 InnoDB: Mutexes and rw_locks use GCC atomic builtins …Run Code Online (Sandbox Code Playgroud) mysqld套接字的版本与mysqld服务器的版本不同是不是有问题?我在启动期间在 mysqld 日志中注意到了这一点
120420 19:30:06 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
120420 19:30:06 InnoDB: Initializing buffer pool, size = 8.0M
120420 19:30:06 InnoDB: Completed initialization of buffer pool
120420 19:30:06 InnoDB: Started; log sequence number 0 44233
120420 19:30:06 [Note] Event Scheduler: Loaded 0 events
120420 19:30:06 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.61' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution
Run Code Online (Sandbox Code Playgroud)
然而,当我显示变量时我得到了这个
显示类似“%version%”的变量;
+-------------------------+-------------------------------------------+
| Variable_name | Value |
+-------------------------+-------------------------------------------+
| innodb_version | 5.5.30 |
| protocol_version | 10 …Run Code Online (Sandbox Code Playgroud) MySQL 可以正常运行数周或数天,然后突然且没有任何用户操作,所有连接尝试都开始失败。这是/var/log/mysqld.log:
160916 14:42:01 [Note] /usr/libexec/mysql55/mysqld: ready for connections.
Version: '5.5.51' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
160930 03:05:51 mysqld_safe Number of processes running now: 0
160930 03:05:52 mysqld_safe mysqld restarted
160930 3:05:53 [Note] /usr/libexec/mysql55/mysqld (mysqld 5.5.51) starting as process 8961 ...
160930 3:05:53 [Note] Plugin 'FEDERATED' is disabled.
160930 3:05:54 InnoDB: The InnoDB memory heap is disabled
160930 3:05:54 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160930 3:05:54 InnoDB: Compressed tables use zlib 1.2.8 …Run Code Online (Sandbox Code Playgroud) mysql ×9
mysqld ×9
mysqld-safe ×2
process ×2
command-line ×1
foreign-key ×1
innodb ×1
instance ×1
mariadb ×1
my.ini ×1
mysql-5.5 ×1
mysql-5.6 ×1
mysql-5.7 ×1
windows ×1