MySql Commands:
To Get into MySql Shell:
sudo -u mysql -p;
To Enter into Mysql SafeMode:
mysqld_safe --skip-grant-tables &
Stop and Start Mysql service
service mysqld stop;
service mysqld start;
Restore Database in Mysql:
mysql -p -u root dbname < dbfilename.sql;
Update or Set Admin Password in MySql:
update mysql.user set password=PASSWORD("123456") where User='root';
To Exit Mysql Shell:
flush privileges; exit;
Create / Drop / Show Database:
Create database dbname;
Drop database dbname;
Show databases;
To View on Which Port MySql is Running(Default Mysql Port 3306):
netstat -tlnp;