• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to find location of MySQL configuration file(s)

By admin

MySQL can read configuration files from different locations, which depend on configuration, platform and build options. Steps below will show a universal approach to list all locations where the configuration file is being looked.

1. Make sure that mysqld process is started without explicit –defaults-file or –defaults-extra-file parameters. Following commands will display actual arguments mysqld is started with:

Linux:

$ ps aux |grep mysqld

Solaris:

$ /usr/ucb/ps -alxwww | grep mysqld

Windows:

Command line arguments are observed in Task Manager when column ‘Command line’ is enabled. (View->’Select Columns’ menu option).

2. Following command will show locations where mysqld process reads configuration files:

Please note that if your MySQL server startup command uses any of options –datadir or –basedir explicitly, you should append them to the list of parameters in the command below to see locations of configuration files.

Unix-like systems:

$ mysqld --help --verbose 2>1 | grep "https://cdn.thegeekdiary.com/my.cnf"

Windows:

% mysqld --help --verbose --console 2>1 | findstr "my.ini"

3. If the command above brings no output, it may be needed to specify the full path to mysqld binary (found in step 1.).

4. If still no success, you may capture output of following command into text file:

$ mysqld --help --verbose

Then look for locations after the following message: “Default options are read from the following files in the given order:”

Understanding the Different Configuration files used for MySQL Server

Filed Under: mysql

Some more articles you might also be interested in …

  1. MySQL – How to undo (rollback) a set of SQL statements
  2. Understanding MySQL Query Cache
  3. “expect” script to provide password to mysql_config_editor
  4. Multi-Versioning in MySQL Database
  5. MySQL Table Maintenance – InnoDB, MyISAM, MEMORY, ARCHIVE
  6. Understanding the Different Configuration files used for MySQL Server
  7. How to Set Space limits for MySQL for database/schema/table
  8. How to obtain MySQL metadata (metadata access methods)
  9. What is the purpose of “system user” in MySQL Replication
  10. Backup and Restore Of Group Replication Node ( MySQL 8.0 )

You May Also Like

Primary Sidebar

Recent Posts

  • How to Disable IPv6 on Ubuntu 18.04 Bionic Beaver Linux
  • How to Capture More Logs in /var/log/dmesg for CentOS/RHEL
  • Unable to Start RDMA Services on CentOS/RHEL 7
  • How to rename a KVM VM with virsh
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary