Use MySQL in the terminal

Tram Ho

Normally, newbie like me will often use tools such as workbench, PhpMyadmin, … to manipulate the database. But for the linux operating system has supported an easier, simpler, faster and cooler way to do it. I will show you the commands to be able to use mysql in the terminal. To access the database from the terminal, use the following command

If you type correctly, the terminal will force you to enter mk of mysql and the result if you enter correctly is:

To change the mk of root user use the following command:

To exit mysql we use the command

To show all the database in mysql we use

The result looks like this

To create the database

To create a table inside the database, we first have to choose which database to use

To create a new table

To see all the tables in the database

To see the information of the columns in that table

Add a record to the table

See the records in the table

Clear goals in the table

Add a column to the table

Delete columns in the table

So I have introduced to you one more way to be able to manipulate databases.

See now

https://dev.mysql.com/doc/mysql-getting-started/en/

Share the news now

Source : Viblo