How do I run a MySQL query in terminal?

How do I run a MySQL query in terminal?
Answer
Pro tip
  1. Execute MySQL Client using the following command: mysql -u root -p.
  2. It is important to Create a New Database first using the command: create database demo_db;
  3. Then you have to Authorize the Database using the command: grant all on demo_db.* to ‘testuser’ identified by ‘12345’;
 

Tìm kiếm

Back
Top