{
    "mode": "man",
    "parameter": "MYSQL_CONFIG_EDITOR",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/MYSQL_CONFIG_EDITOR/1/json",
    "generated": "2026-09-21T06:49:45Z",
    "synopsis": "mysqlconfigeditor options command",
    "sections": {
        "NAME": {
            "content": "mysqlconfigeditor - configure authentication information for connecting to MySQL server\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "mysqlconfigeditor options command\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The mysqlconfigeditor utility enables you to store authentication credentials in an\nobfuscated login path file named .mylogin.cnf. The file location is the %APPDATA%\\MySQL\ndirectory on Windows and the current user's home directory on non-Windows systems. The file\ncan be read later by MySQL client programs to obtain authentication credentials for\nconnecting to MySQL Server.\n\nThe unobfuscated format of the .mylogin.cnf login path file consists of option groups,\nsimilar to other option files. Each option group in .mylogin.cnf is called a “login path,”\nwhich is a group that permits only certain options: host, user, password, port and socket.\nThink of a login path option group as a set of options that specify which MySQL server to\nconnect to and which account to authenticate as. Here is an unobfuscated example:\n\n[client]\nuser = mydefaultname\npassword = mydefaultpass\nhost = 127.0.0.1\n[mypath]\nuser = myothername\npassword = myotherpass\nhost = localhost\n\nWhen you invoke a client program to connect to the server, the client uses .mylogin.cnf in\nconjunction with other option files. Its precedence is higher than other option files, but\nless than options specified explicitly on the client command line. For information about the\norder in which option files are used, see Section 6.2.2.2, “Using Option Files”.\n\nTo specify an alternate login path file name, set the MYSQLTESTLOGINFILE environment\nvariable. This variable is recognized by mysqlconfigeditor, by standard MySQL clients\n(mysql, mysqladmin, and so forth), and by the mysql-test-run.pl testing utility.\n\nPrograms use groups in the login path file as follows:\n\n•   mysqlconfigeditor operates on the client login path by default if you specify no\n--login-path=name option to indicate explicitly which login path to use.\n\n•   Without a --login-path option, client programs read the same option groups from the login\npath file that they read from other option files. Consider this command:\n\nmysql\n\nBy default, the mysql client reads the [client] and [mysql] groups from other option\nfiles, so it reads them from the login path file as well.\n\n•   With a --login-path option, client programs additionally read the named login path from\nthe login path file. The option groups read from other option files remain the same.\nConsider this command:\n\nmysql --login-path=mypath\n\nThe mysql client reads [client] and [mysql] from other option files, and [client],\n[mysql], and [mypath] from the login path file.\n\n•   Client programs read the login path file even when the --no-defaults option is used,\nunless --no-login-paths is set. This permits passwords to be specified in a safer way\nthan on the command line even if --no-defaults is present.\n\nmysqlconfigeditor obfuscates the .mylogin.cnf file so it cannot be read as cleartext, and\nits contents when unobfuscated by client programs are used only in memory. In this way,\npasswords can be stored in a file in non-cleartext format and used later without ever needing\nto be exposed on the command line or in an environment variable.  mysqlconfigeditor\nprovides a print command for displaying the login path file contents, but even in this case,\npassword values are masked so as never to appear in a way that other users can see them.\n\nThe obfuscation used by mysqlconfigeditor prevents passwords from appearing in .mylogin.cnf\nas cleartext and provides a measure of security by preventing inadvertent password exposure.\nFor example, if you display a regular unobfuscated my.cnf option file on the screen, any\npasswords it contains are visible for anyone to see. With .mylogin.cnf, that is not true, but\nthe obfuscation used is not likely to deter a determined attacker and you should not consider\nit unbreakable. A user who can gain system administration privileges on your machine to\naccess your files could unobfuscate the .mylogin.cnf file with some effort.\n\nThe login path file must be readable and writable to the current user, and inaccessible to\nother users. Otherwise, mysqlconfigeditor ignores it, and client programs do not use it,\neither.\n\nInvoke mysqlconfigeditor like this:\n\nmysqlconfigeditor [programoptions] command [commandoptions]\n\nIf the login path file does not exist, mysqlconfigeditor creates it.\n\nCommand arguments are given as follows:\n\n•   programoptions consists of general mysqlconfigeditor options.\n\n•   command indicates what action to perform on the .mylogin.cnf login path file. For\nexample, set writes a login path to the file, remove removes a login path, and print\ndisplays login path contents.\n\n•   commandoptions indicates any additional options specific to the command, such as the\nlogin path name and the values to use in the login path.\n\nThe position of the command name within the set of program arguments is significant. For\nexample, these command lines have the same arguments, but produce different results:\n\nmysqlconfigeditor --help set\nmysqlconfigeditor set --help\n\nThe first command line displays a general mysqlconfigeditor help message, and ignores the\nset command. The second command line displays a help message specific to the set command.\n\nSuppose that you want to establish a client login path that defines your default connection\nparameters, and an additional login path named remote for connecting to the MySQL server the\nhost remote.example.com. You want to log in as follows:\n\n•   By default, to the local server with a user name and password of localuser and localpass\n\n•   To the remote server with a user name and password of remoteuser and remotepass\n\nTo set up the login paths in the .mylogin.cnf file, use the following set commands. Enter\neach command on a single line, and enter the appropriate passwords when prompted:\n\n$> mysqlconfigeditor set --login-path=client\n--host=localhost --user=localuser --password\nEnter password: enter password \"localpass\" here\n$> mysqlconfigeditor set --login-path=remote\n--host=remote.example.com --user=remoteuser --password\nEnter password: enter password \"remotepass\" here\n\nmysqlconfigeditor uses the client login path by default, so the --login-path=client option\ncan be omitted from the first command without changing its effect.\n\nTo see what mysqlconfigeditor writes to the .mylogin.cnf file, use the print command:\n\n$> mysqlconfigeditor print --all\n[client]\nuser = localuser\npassword = *\nhost = localhost\n[remote]\nuser = remoteuser\npassword = *\nhost = remote.example.com\n\nThe print command displays each login path as a set of lines beginning with a group header\nindicating the login path name in square brackets, followed by the option values for the\nlogin path. Password values are masked and do not appear as cleartext.\n\nIf you do not specify --all to display all login paths or --login-path=name to display a\nnamed login path, the print command displays the client login path by default, if there is\none.\n\nAs shown by the preceding example, the login path file can contain multiple login paths. In\nthis way, mysqlconfigeditor makes it easy to set up multiple “personalities” for connecting\nto different MySQL servers, or for connecting to a given server using different accounts. Any\nof these can be selected by name later using the --login-path option when you invoke a client\nprogram. For example, to connect to the remote server, use this command:\n\nmysql --login-path=remote\n\nHere, mysql reads the [client] and [mysql] option groups from other option files, and the\n[client], [mysql], and [remote] groups from the login path file.\n\nTo connect to the local server, use this command:\n\nmysql --login-path=client\n\nBecause mysql reads the client and mysql login paths by default, the --login-path option does\nnot add anything in this case. That command is equivalent to this one:\n\nmysql\n\nOptions read from the login path file take precedence over options read from other option\nfiles. Options read from login path groups appearing later in the login path file take\nprecedence over options read from groups appearing earlier in the file.\n\nmysqlconfigeditor adds login paths to the login path file in the order you create them, so\nyou should create more general login paths first and more specific paths later. If you need\nto move a login path within the file, you can remove it, then recreate it to add it to the\nend. For example, a client login path is more general because it is read by all client\nprograms, whereas a mysqldump login path is read only by mysqldump. Options specified later\noverride options specified earlier, so putting the login paths in the order client, mysqldump\nenables mysqldump-specific options to override client options.\n\nWhen you use the set command with mysqlconfigeditor to create a login path, you need not\nspecify all possible option values (host name, user name, password, port, socket). Only those\nvalues given are written to the path. Any missing values required later can be specified when\nyou invoke a client path to connect to the MySQL server, either in other option files or on\nthe command line. Any options specified on the command line override those specified in the\nlogin path file or other option files. For example, if the credentials in the remote login\npath also apply for the host remote2.example.com, connect to the server on that host like\nthis:\n\nmysql --login-path=remote --host=remote2.example.com\n\nmysqlconfigeditor General Options\n\nmysqlconfigeditor supports the following general options, which may be used preceding any\ncommand named on the command line. For descriptions of command-specific options, see\nmysqlconfigeditor Commands and Command-Specific Options.\n\n•   --help, -?\n┌─────────────────────┬────────┐\n│ Command-Line Format │ --help │\n└─────────────────────┴────────┘\n\nDisplay a general help message and exit.\n\nTo see a command-specific help message, invoke mysqlconfigeditor as follows, where\ncommand is a command other than help:\n\nmysqlconfigeditor command --help\n\n•   --debug[=debugoptions], -# debugoptions\n┌─────────────────────┬─────────────────────────┐\n│ Command-Line Format │ --debug[=debugoptions] │\n├─────────────────────┼─────────────────────────┤\n│ Type                │ String                  │\n├─────────────────────┼─────────────────────────┤\n│ Default Value       │ d:t:o                   │\n└─────────────────────┴─────────────────────────┘\n\nWrite a debugging log. A typical debugoptions string is d:t:o,filename. The default is\nd:t:o,/tmp/mysqlconfigeditor.trace.\n\nThis option is available only if MySQL was built using WITHDEBUG. MySQL release binaries\nprovided by Oracle are not built using this option.\n\n•   --verbose, -v\n┌─────────────────────┬───────────┐\n│ Command-Line Format │ --verbose │\n└─────────────────────┴───────────┘\n\nVerbose mode. Print more information about what the program does. This option may be\nhelpful in diagnosing problems if an operation does not have the effect you expect.\n\n•   --version, -V\n┌─────────────────────┬───────────┐\n│ Command-Line Format │ --version │\n└─────────────────────┴───────────┘\n\nDisplay version information and exit.\nmysqlconfigeditor Commands and Command-Specific Options\n\nThis section describes the permitted mysqlconfigeditor commands, and, for each one, the\ncommand-specific options permitted following the command name on the command line.\n\nIn addition, mysqlconfigeditor supports general options that can be used preceding any\ncommand. For descriptions of these options, see mysqlconfigeditor General Options.\n\nmysqlconfigeditor supports these commands:\n\n•   help\n\nDisplay a general help message and exit. This command takes no following options.\n\nTo see a command-specific help message, invoke mysqlconfigeditor as follows, where\ncommand is a command other than help:\n\nmysqlconfigeditor command --help\n\n•   print [options]\n\nPrint the contents of the login path file in unobfuscated form, with the exception that\npasswords are displayed as *.\n\nThe default login path name is client if no login path is named. If both --all and\n--login-path are given, --all takes precedence.\n\nThe print command permits these options following the command name:\n\n•   --help, -?\n\nDisplay a help message for the print command and exit.\n\nTo see a general help message, use mysqlconfigeditor --help.\n\n•   --all\n\nPrint the contents of all login paths in the login path file.\n\n•   --login-path=name, -G name\n\nPrint the contents of the named login path.\n\n•   remove [options]\n\nRemove a login path from the login path file, or modify a login path by removing options\nfrom it.\n\nThis command removes from the login path only such options as are specified with the\n--host, --password, --port, --socket, and --user options. If none of those options are\ngiven, remove removes the entire login path. For example, this command removes only the\nuser option from the mypath login path rather than the entire mypath login path:\n\nmysqlconfigeditor remove --login-path=mypath --user\n\nThis command removes the entire mypath login path:\n\nmysqlconfigeditor remove --login-path=mypath\n\nThe remove command permits these options following the command name:\n\n•   --help, -?\n\nDisplay a help message for the remove command and exit.\n\nTo see a general help message, use mysqlconfigeditor --help.\n\n•   --host, -h\n\nRemove the host name from the login path.\n\n•   --login-path=name, -G name\n\nThe login path to remove or modify. The default login path name is client if this\noption is not given.\n\n•   --password, -p\n\nRemove the password from the login path.\n\n•   --port, -P\n\nRemove the TCP/IP port number from the login path.\n\n•   --socket, -S\n\nRemove the Unix socket file name from the login path.\n\n•   --user, -u\n\nRemove the user name from the login path.\n\n•   --warn, -w\n\nWarn and prompt the user for confirmation if the command attempts to remove the\ndefault login path (client) and --login-path=client was not specified. This option is\nenabled by default; use --skip-warn to disable it.\n\n•   reset [options]\n\nEmpty the contents of the login path file.\n\nThe reset command permits these options following the command name:\n\n•   --help, -?\n\nDisplay a help message for the reset command and exit.\n\nTo see a general help message, use mysqlconfigeditor --help.\n\n•   set [options]\n\nWrite a login path to the login path file.\n\nThis command writes to the login path only such options as are specified with the --host,\n--password, --port, --socket, and --user options. If none of those options are given,\nmysqlconfigeditor writes the login path as an empty group.\n\nThe set command permits these options following the command name:\n\n•   --help, -?\n\nDisplay a help message for the set command and exit.\n\nTo see a general help message, use mysqlconfigeditor --help.\n\n•   --host=hostname, -h hostname\n\nThe host name to write to the login path.\n\n•   --login-path=name, -G name\n\nThe login path to create. The default login path name is client if this option is not\ngiven.\n\n•   --password, -p\n\nPrompt for a password to write to the login path. After mysqlconfigeditor displays\nthe prompt, type the password and press Enter. To prevent other users from seeing the\npassword, mysqlconfigeditor does not echo it.\n\nTo specify an empty password, press Enter at the password prompt. The resulting login\npath written to the login path file includes a line like this:\n\npassword =\n\n•   --port=portnum, -P portnum\n\nThe TCP/IP port number to write to the login path.\n\n•   --socket=filename, -S filename\n\nThe Unix socket file name to write to the login path.\n\n•   --user=username, -u username\n\nThe user name to write to the login path.\n\n•   --warn, -w\n\nWarn and prompt the user for confirmation if the command attempts to overwrite an\nexisting login path. This option is enabled by default; use --skip-warn to disable\nit.\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright © 1997, 2026, Oracle and/or its affiliates.\n\nThis documentation is free software; you can redistribute it and/or modify it only under the\nterms of the GNU General Public License as published by the Free Software Foundation; version\n2 of the License.\n\nThis documentation is distributed in the hope that it will be useful, but WITHOUT ANY\nWARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\nPURPOSE. See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with the program; if\nnot, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\n02110-1301 USA or see http://www.gnu.org/licenses/.\n\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "For more information, please refer to the MySQL Reference Manual, which may already be\ninstalled locally and which is also available online at http://dev.mysql.com/doc/.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Oracle Corporation (http://dev.mysql.com/).\n\nMySQL 8.0                                    03/23/2026                       MYSQLCONFIGEDITOR(1)",
            "subsections": []
        }
    },
    "summary": "mysqlconfigeditor - configure authentication information for connecting to MySQL server",
    "flags": [],
    "examples": [],
    "see_also": []
}