# see tutorial: https://www.digitalocean.com/community/tutorials/a-basic-mysql-tutorial
mysql -u root -p # login db
SHOW DATABASES; # show databases
CREATE DATABASE database_name; # create database
DROP DATABASE database_name; # clean database
USE events; # open data base we want to use.
SHOW tables; # show tables of chocen db
# change password for root
sudo /etc/init.d/mysql stop
sudo mysqld --skip-grant-tables &
mysql -u root mysql
UPDATE user SET Password=PASSWORD('YOURNEWPASSWORD') WHERE User='root'; FLUSH PRIVILEGES; exit;
# Copy/duplicate database without using mysqldump
mysqldump -h [server] -u [user] -p[password] db1 | mysql -h [server] -u [user] -p[password] db2
# example:
mysqldump -u root -p db1| mysql -u root -p db2; # and two times enter password (one after another)