52 Contributors: 3 Thursday, September 22, 2016
Licensed under: CC-BY-SA
Not affiliated with Stack Overflow
Rip Tutorial:
Roadmap: roadmap

MySQL client


  • mysql [OPTIONS] [database_name]


-D --database=namename of the database
--delimiter=strset the statement delimiter. The default one is ';'
-e --execute='command'execute command
-h --host=namehostname to connect to
-p --password=namepassword Note: there is no space between -p and the password
-p (without password)the password will be prompted for
-P --port=#port number
-s --silentsilent mode, produce less output. Use \t as column separator
-sslike -s, but omit column names
-S --socket=pathspecify the socket (Unix) or named pipe (Windows) to use when connecting to a local instance
--skip-column-namesomit column names
-u --user=nameusername
-U --safe-updates --i-am-a-dummylogin with the variable sql_safe_updates=ON. This will allow only DELETE and UPDATE that explicitly use keys
-V --versionprint the version and exit

Related Examples