mysql -uroot -proot -e 'create database mydb;'
MySQL version is
mysql Ver 14.14 Distrib 5.5.14, for Win64 (x86)
When I run the command, it just shows the help information. Please help.
mysql -uroot -proot -e 'create database mydb;'
MySQL version is
mysql Ver 14.14 Distrib 5.5.14, for Win64 (x86)
When I run the command, it just shows the help information. Please help.
Change your single quotes to double quotes:
mysql -uroot -proot -e "create database mydb;"
I'm running mysql Ver 14.14 Distrib 5.5.16, for Win32 (x86)
Ver 14.12 Distrib 5.0.77, for redhat-linux-gnu (x86_64) using readline 5.1... for Win64 (x86), so it's quite plausible that the OP is using the Windows command prompt, which will treat 'create database mydb;' as three arguments, just like "'create" database "mydb;'".