简体   繁体   English

在哪里可以找到包含所有参数的 mysql 配置文件?

[英]Where can I find mysql config file with all parameters?

Where can I find mysql config file with all parameters?在哪里可以找到包含所有参数的 mysql 配置文件? I found some config files in我发现了一些配置文件

/etc/mysql/ /etc/mysql/

directory but there isnt any file with all parameters !目录,但没有任何文件包含所有参数!

Actually I want my machine's mysql server to be remotely accessed.其实我想远程访问我机器的 mysql 服务器。 So I was finding " bind-address " parameter in the file but there is not one file with all parameters: These are the files I found in this directory:所以我在文件中找到了“ bind-address ”参数,但没有一个文件包含所有参数:这些是我在这个目录中找到的文件:

./conf.d 
./conf.d/mysql.cnf 
./conf.d/mysqldump.cnf 
./debian-start 
./debian.cnf 
./mariadb.cnf 
./mariadb.conf.d 
./mariadb.conf.d/50-client.cnf 
./mariadb.conf.d/50-mysql-clients.cnf 
./mariadb.conf.d/50-mysqld_safe.cnf 
./mariadb.conf.d/50-server.cnf 
./my.cnf.fallback 
./my.cnf

I read some articles saying that my.cnf is the mysql config file but there is no bind-address or anything this is the output of my.cnf file.我读过一些文章说 my.cnf 是 mysql 配置文件,但没有绑定地址或任何东西这是 my.cnf 文件的 output。

# The MariaDB configuration file
#
# The MariaDB/MySQL tools read configuration files in the following order:
# 1. "/etc/mysql/mariadb.cnf" (this file) to set global defaults,
# 2. "/etc/mysql/conf.d/*.cnf" to set global options.
# 3. "/etc/mysql/mariadb.conf.d/*.cnf" to set MariaDB-only options.
# 4. "~/.my.cnf" to set user-specific options.
#
# If the same option is defined multiple times, the last one will apply.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.

#
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]

# Import all .cnf files from configuration directory
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/

mysql version: mysql Ver 15.1 Distrib 10.3.22-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2 mysql 版本: mysql Ver 15.1 Distrib 10.3.22-MariaDB,适用于使用 readline 5.2 的 debian-linux-gnu (x86_64)

Machine name and version:机器名称和版本:

1. Linux parrot 5.6.0-2parrot1-amd64 #1 SMP Debian 5.6.14-2parrot1 (2020-05-23) x86_64 GNU/Linux 1. Linux parrot 5.6.0-2parrot1-amd64 #1 SMP Debian 5.6.14-2parrot1 (2020-05-23) x86_64 GNU/Linux

2. Linux ubuntu-VirtualBox 4.15.0-106-generic #107~16.04.1-Ubuntu SMP Thu Jun 4 15:39:45 UTC 2020 i686 i686 i686 GNU/Linux 2. Linux ubuntu-VirtualBox 4.15.0-106-generic #107~16.04.1-Ubuntu SMP Thu Jun 4 15:39:45 UTC 2020 i686 i686 i686 GNU/Linux

Do you want the settings you put in my.cnf or some other file?您想要放在my.cnf或其他文件中的设置吗?

Or do you want all 500 or so settings, including the defaults, such as in SHOW VARIABLES ?还是您想要所有 500 种左右的设置,包括默认值,例如在SHOW VARIABLES中?

Try tables like:尝试如下表:

use performance_schema;使用性能模式; select * from.global_variables where variable_name in ('bind address','port'); select * from.global_variables where variable_name in ('bind address','port');

松鼠选择

You can see the search path for my.cnf file by using the following command: sudo mysqld --help --verbose |您可以使用以下命令查看 my.cnf 文件的搜索路径:sudo mysqld --help --verbose | grep cnf grep cnf

The normal search path is: /etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf /.my.cnf正常的搜索路径是:/etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf /.my.cnf

And, if not present then create a /etc/my.cnf file.并且,如果不存在,则创建一个 /etc/my.cnf 文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM