{
    "mode": "info",
    "parameter": "MYSQL_CONFIG_EDITOR",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/MYSQL_CONFIG_EDITOR/json",
    "generated": "2026-07-05T11:52:33Z",
    "synopsis": "mysqlconfigeditor options command",
    "sections": {
        "NAME": {
            "content": "mysqlconfigeditor - configure authentication information for\nconnecting to MySQL server\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "mysqlconfigeditor options command\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The mysqlconfigeditor utility enables you to store authentication\ncredentials in an obfuscated login path file named .mylogin.cnf. The\nfile location is the %APPDATA%\\MySQL directory on Windows and the\ncurrent user's home directory on non-Windows systems. The file can be\nread later by MySQL client programs to obtain authentication\ncredentials for connecting to MySQL Server.\n\nThe unobfuscated format of the .mylogin.cnf login path file consists of\noption groups, similar to other option files. Each option group in\n.mylogin.cnf is called a \"login path,\" which is a group that permits\nonly certain options: host, user, password, port and socket. Think of a\nlogin path option group as a set of options that specify which MySQL\nserver to connect to and which account to authenticate as. Here is an\nunobfuscated 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\nuses .mylogin.cnf in conjunction with other option files. Its\nprecedence is higher than other option files, but less than options\nspecified explicitly on the client command line. For information about\nthe order in which option files are used, see Section 6.2.2.2, \"Using\nOption Files\".\n\nTo specify an alternate login path file name, set the\nMYSQLTESTLOGINFILE environment variable. This variable is recognized\nby mysqlconfigeditor, by standard MySQL clients (mysql, mysqladmin,\nand so forth), and by the mysql-test-run.pl testing utility.\n\nPrograms use groups in the login path file as follows:\n\no   mysqlconfigeditor operates on the client login path by default if\nyou specify no --login-path=name option to indicate explicitly\nwhich login path to use.\n\no   Without a --login-path option, client programs read the same option\ngroups from the login path file that they read from other option\nfiles. Consider this command:\n\nmysql\n\nBy default, the mysql client reads the [client] and [mysql] groups\nfrom other option files, so it reads them from the login path file\nas well.\n\no   With a --login-path option, client programs additionally read the\nnamed login path from the login path file. The option groups read\nfrom other option files remain the same. Consider this command:\n\nmysql --login-path=mypath\n\nThe mysql client reads [client] and [mysql] from other option\nfiles, and [client], [mysql], and [mypath] from the login path\nfile.\n\no   Client programs read the login path file even when the\n--no-defaults option is used, unless --no-login-paths is set. This\npermits passwords to be specified in a safer way than on the\ncommand line even if --no-defaults is present.\n\nmysqlconfigeditor obfuscates the .mylogin.cnf file so it cannot be\nread as cleartext, and its contents when unobfuscated by client\nprograms are used only in memory. In this way, passwords can be stored\nin a file in non-cleartext format and used later without ever needing\nto be exposed on the command line or in an environment variable.\nmysqlconfigeditor provides a print command for displaying the login\npath file contents, but even in this case, password values are masked\nso as never to appear in a way that other users can see them.\n\nThe obfuscation used by mysqlconfigeditor prevents passwords from\nappearing in .mylogin.cnf as cleartext and provides a measure of\nsecurity by preventing inadvertent password exposure. For example, if\nyou display a regular unobfuscated my.cnf option file on the screen,\nany passwords it contains are visible for anyone to see. With\n.mylogin.cnf, that is not true, but the obfuscation used is not likely\nto deter a determined attacker and you should not consider it\nunbreakable. A user who can gain system administration privileges on\nyour machine to access your files could unobfuscate the .mylogin.cnf\nfile with some effort.\n\nThe login path file must be readable and writable to the current user,\nand inaccessible to other users. Otherwise, mysqlconfigeditor ignores\nit, and client programs do not use it, either.\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\no   programoptions consists of general mysqlconfigeditor options.\n\no   command indicates what action to perform on the .mylogin.cnf login\npath file. For example, set writes a login path to the file, remove\nremoves a login path, and print displays login path contents.\n\no   commandoptions indicates any additional options specific to the\ncommand, such as the login path name and the values to use in the\nlogin path.\n\nThe position of the command name within the set of program arguments is\nsignificant. For example, these command lines have the same arguments,\nbut produce different results:\n\nmysqlconfigeditor --help set\nmysqlconfigeditor set --help\n\nThe first command line displays a general mysqlconfigeditor help\nmessage, and ignores the set command. The second command line displays\na help message specific to the set command.\n\nSuppose that you want to establish a client login path that defines\nyour default connection parameters, and an additional login path named\nremote for connecting to the MySQL server the host remote.example.com.\nYou want to log in as follows:\n\no   By default, to the local server with a user name and password of\nlocaluser and localpass\n\no   To the remote server with a user name and password of remoteuser\nand remotepass\n\nTo set up the login paths in the .mylogin.cnf file, use the following\nset commands. Enter each command on a single line, and enter the\nappropriate 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\n--login-path=client option can be omitted from the first command\nwithout changing its effect.\n\nTo see what mysqlconfigeditor writes to the .mylogin.cnf file, use\nthe 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\nwith a group header indicating the login path name in square brackets,\nfollowed by the option values for the login path. Password values are\nmasked and do not appear as cleartext.\n\nIf you do not specify --all to display all login paths or\n--login-path=name to display a named login path, the print command\ndisplays the client login path by default, if there is one.\n\nAs shown by the preceding example, the login path file can contain\nmultiple login paths. In this way, mysqlconfigeditor makes it easy to\nset up multiple \"personalities\" for connecting to different MySQL\nservers, or for connecting to a given server using different accounts.\nAny of these can be selected by name later using the --login-path\noption when you invoke a client program. For example, to connect to the\nremote server, use this command:\n\nmysql --login-path=remote\n\nHere, mysql reads the [client] and [mysql] option groups from other\noption files, and the [client], [mysql], and [remote] groups from the\nlogin 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\n--login-path option does not add anything in this case. That command is\nequivalent to this one:\n\nmysql\n\nOptions read from the login path file take precedence over options read\nfrom other option files. Options read from login path groups appearing\nlater in the login path file take precedence over options read from\ngroups appearing earlier in the file.\n\nmysqlconfigeditor adds login paths to the login path file in the\norder you create them, so you should create more general login paths\nfirst and more specific paths later. If you need to move a login path\nwithin 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\nread by all client programs, whereas a mysqldump login path is read\nonly by mysqldump. Options specified later override options specified\nearlier, 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\npath, you need not specify all possible option values (host name, user\nname, password, port, socket). Only those values given are written to\nthe path. Any missing values required later can be specified when you\ninvoke a client path to connect to the MySQL server, either in other\noption files or on the command line. Any options specified on the\ncommand line override those specified in the login path file or other\noption files. For example, if the credentials in the remote login path\nalso apply for the host remote2.example.com, connect to the server on\nthat host like this:\n\nmysql --login-path=remote --host=remote2.example.com\n\nmysqlconfigeditor General Options\n\nmysqlconfigeditor supports the following general options, which may\nbe used preceding any command named on the command line. For\ndescriptions of command-specific options, see mysqlconfigeditor\nCommands and Command-Specific Options.\n\no   --help, -?\n\n+--------------------+--------+\n|Command-Line Format | --help |\n+--------------------+--------+\nDisplay a general help message and exit.\n\nTo see a command-specific help message, invoke mysqlconfigeditor\nas follows, where command is a command other than help:\n\nmysqlconfigeditor command --help\n\no   --debug[=debugoptions], -# debugoptions\n\n+--------------------+-------------------------+\n|Command-Line Format | --debug[=debugoptions] |\n+--------------------+-------------------------+\n|Type                | String                  |\n+--------------------+-------------------------+\n|Default Value       | d:t:o                   |\n+--------------------+-------------------------+\nWrite a debugging log. A typical debugoptions string is\nd:t:o,filename. The default is\nd:t:o,/tmp/mysqlconfigeditor.trace.\n\nThis option is available only if MySQL was built using WITHDEBUG.\nMySQL release binaries provided by Oracle are not built using this\noption.\n\no   --verbose, -v\n\n+--------------------+-----------+\n|Command-Line Format | --verbose |\n+--------------------+-----------+\nVerbose mode. Print more information about what the program does.\nThis option may be helpful in diagnosing problems if an operation\ndoes not have the effect you expect.\n\no   --version, -V\n\n+--------------------+-----------+\n|Command-Line Format | --version |\n+--------------------+-----------+\nDisplay version information and exit.\nmysqlconfigeditor Commands and Command-Specific Options\n\nThis section describes the permitted mysqlconfigeditor commands, and,\nfor each one, the command-specific options permitted following the\ncommand name on the command line.\n\nIn addition, mysqlconfigeditor supports general options that can be\nused preceding any command. For descriptions of these options, see\nmysqlconfigeditor General Options.\n\nmysqlconfigeditor supports these commands:\n\no   help\n\nDisplay a general help message and exit. This command takes no\nfollowing options.\n\nTo see a command-specific help message, invoke mysqlconfigeditor\nas follows, where command is a command other than help:\n\nmysqlconfigeditor command --help\n\no   print [options]\n\nPrint the contents of the login path file in unobfuscated form,\nwith the exception that passwords are displayed as *.\n\nThe default login path name is client if no login path is named. If\nboth --all and --login-path are given, --all takes precedence.\n\nThe print command permits these options following the command name:\n\no   --help, -?\n\nDisplay a help message for the print command and exit.\n\nTo see a general help message, use mysqlconfigeditor --help.\n\no   --all\n\nPrint the contents of all login paths in the login path file.\n\no   --login-path=name, -G name\n\nPrint the contents of the named login path.\n\no   remove [options]\n\nRemove a login path from the login path file, or modify a login\npath by removing options from it.\n\nThis command removes from the login path only such options as are\nspecified with the --host, --password, --port, --socket, and --user\noptions. If none of those options are given, remove removes the\nentire login path. For example, this command removes only the user\noption from the mypath login path rather than the entire mypath\nlogin 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\nname:\n\no   --help, -?\n\nDisplay a help message for the remove command and exit.\n\nTo see a general help message, use mysqlconfigeditor --help.\n\no   --host, -h\n\nRemove the host name from the login path.\n\no   --login-path=name, -G name\n\nThe login path to remove or modify. The default login path name\nis client if this option is not given.\n\no   --password, -p\n\nRemove the password from the login path.\n\no   --port, -P\n\nRemove the TCP/IP port number from the login path.\n\no   --socket, -S\n\nRemove the Unix socket file name from the login path.\n\no   --user, -u\n\nRemove the user name from the login path.\n\no   --warn, -w\n\nWarn and prompt the user for confirmation if the command\nattempts to remove the default login path (client) and\n--login-path=client was not specified. This option is enabled\nby default; use --skip-warn to disable it.\n\no   reset [options]\n\nEmpty the contents of the login path file.\n\nThe reset command permits these options following the command name:\n\no   --help, -?\n\nDisplay a help message for the reset command and exit.\n\nTo see a general help message, use mysqlconfigeditor --help.\n\no   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\nspecified with the --host, --password, --port, --socket, and --user\noptions. If none of those options are given, mysqlconfigeditor\nwrites the login path as an empty group.\n\nThe set command permits these options following the command name:\n\no   --help, -?\n\nDisplay a help message for the set command and exit.\n\nTo see a general help message, use mysqlconfigeditor --help.\n\no   --host=hostname, -h hostname\n\nThe host name to write to the login path.\n\no   --login-path=name, -G name\n\nThe login path to create. The default login path name is client\nif this option is not given.\n\no   --password, -p\n\nPrompt for a password to write to the login path. After\nmysqlconfigeditor displays the prompt, type the password and\npress Enter. To prevent other users from seeing the password,\nmysqlconfigeditor does not echo it.\n\nTo specify an empty password, press Enter at the password\nprompt. The resulting login path written to the login path file\nincludes a line like this:\n\npassword =\n\no   --port=portnum, -P portnum\n\nThe TCP/IP port number to write to the login path.\n\no   --socket=filename, -S filename\n\nThe Unix socket file name to write to the login path.\n\no   --user=username, -u username\n\nThe user name to write to the login path.\n\no   --warn, -w\n\nWarn and prompt the user for confirmation if the command\nattempts to overwrite an existing login path. This option is\nenabled by default; use --skip-warn to disable it.\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright (C) 1997, 2024, Oracle and/or its affiliates.\n\nThis documentation is free software; you can redistribute it and/or\nmodify it only under the terms of the GNU General Public License as\npublished by the Free Software Foundation; version 2 of the License.\n\nThis documentation is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\nGeneral Public License for more details.\n\nYou should have received a copy of the GNU General Public License along\nwith the program; if not, write to the Free Software Foundation, Inc.,\n51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see\nhttp://www.gnu.org/licenses/.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "For more information, please refer to the MySQL Reference Manual, which\nmay already be installed locally and which is also available online at\nhttp://dev.mysql.com/doc/.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Oracle Corporation (http://dev.mysql.com/).\n\nMySQL 8.0                         12/13/2024            MYSQLCONFIGEDITOR(1)",
            "subsections": []
        }
    },
    "summary": "mysqlconfigeditor - configure authentication information for connecting to MySQL server",
    "flags": [],
    "examples": [],
    "see_also": []
}