I want to create simple tables, insert values in it, and do queries. How to perform them in the terminal?
You make a database by typing
In the prompt you enter, you then start by creating your database (as explained by onik in the comments):
Once you have made that database, you can experiment with it. You can simply type
As described in Sauruv's answer you can also connect to the database as follows (without the space between p and your password or better, just do not use the -p option and you will get a password prompt [credits go to onik]):
Here is the syntax to execute sql statement from terminal
I'm assuming that you are using
And of-course you can create a database using terminal itself
Hope it helps you.. Reply if you need further assistance..
mysql is a simple command-line tool. mysql is command line and it is very easy to use. Invoke it from the prompt of your command interpreter as follows:
You may need to provide mysql username, password and hostname, use:
To list database type the following command
information_schema and mysql are name of databases. To use these database and to list available tables type the following two commands:
Now list tables: