I am not able to create a database. I get a bash create command not found error on entering fir example: create database rattic; please help

CentOS version 6.5

  • It sounds like you're trying to use MySQL. You have to enter a MySQL prompt before creating a database. Here is a handy guide for getting started with MySQL. – Gene Oct 6 '14 at 8:42

The problem is that Bash is a system shell; not a DB shell. Assuming that you are using MySQL, you can get to a DB shell with the following command:

mysql -uroot -p

If you'd rather just use bash, it can be done but you still need to run the command through MySQL:

mysql -uroot -p -e "create database 'foo'"

For both of these commands, the -p option will tell it to ask you for a password. If you don't have one set on your root account (the default setup) then you don't need that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.