Stardust

MYSQL Useful Commands

Restart:

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

Stop:

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

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/host.host.com.err

That’s all folks, see you  later!

Leave a Reply

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