When I start using Cpanel I thought it was such a perfect and wonderful server management software. Especially when it comes to GUI for database managemenet - phpmyadmin. Slowly, I've moved to ubuntu nginx which has a higher performance when my website scales. There is no GUI for database management in nginx by default. This is why this list comes to handy whenever you need to setup, manage your Mysql Database using SSH.
mysql -u[username] -p
create database [database-name];
grant all privileges on [database-name].* to '[username]'@'localhost' identified by "[password]";
Change to the directory where your database.sql located
mysql -u root -p password
Login to mysql
Choose and use a database
This will import the .sql into the database.
If you not sure how to upload the .sql file to the server, learn more here
DROP TABLE tablename;
DROP DATABASE dbname;
SELECT user FROM mysql.user GROUP BY user;
DELETE FROM mysql.user WHERE user = 'username';
ListBreak.com © 2018
Time is precious. If you have an alternative or better way to get this done, do let us know so that we can compose this list and help more people.