MYSQL Useful Commands


systemctl restart mysqld.service
/etc/init.d/mysql restart


systemctl stop mysqld.service
/etc/init.d/mysql stop

systemctl start mysqld.service
/etc/init.d/mysql start

Commands after logged in:

Create database:

create database [databasename];

Show databases:

show databases;

Switch to a db:

use [db name];

Show tables of a db:

show tables;

Delete a db:

drop database [database name];

Delete a table:

drop table [table name];

Show all data in a table:

SELECT * FROM [table name];
Error log:
tail -f /var/lib/mysql/

That’s all folks, see you  later!

Leave a Reply

Your email address will not be published. Required fields are marked *