Create, import and export mysql database using terminal

1) To Export a database, open up terminal, making sure that you are not logged into MySQL and type
mysqldump -u [username] -p [database name] > [database name].sql
mysqldump -u root -p admin_ghc > admin_ghc.sql

2) To import a database, first create a new blank database in the MySQL shell to serve as a destination for your data.
CREATE DATABASE newdatabase;
mysql -u [username] -p newdatabase < [database name].sql 3) stop the MySQL process /etc/init.d/mysql stop

Set up AWS Server in ubuntu 16.04 LTS

1) sudo apt-get update
2) sudo apt-get upgrade
3) sudo vi /etc/environment
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
4) sudo reboot
5) sudo apt-get install apache2
6) sudo apt-get install mysql-server
7) sudo apt-get install php libapache2-mod-php
8) sudo apt-get install php-zip
9) sudo /etc/init.d/apache2 restart
10) sudo apt-get install sendmail-bin
11) sudo apt-get install phpmyadmin
12) sudo vim /etc/apache2/apache2.conf
# phpMyAdmin Configuration
Include /etc/phpmyadmin/apache.conf
13) sudo /etc/init.d/apache2 restart
14) sudo apt-get install vsftpd
15) sudo vim /etc/vsftpd.conf
uncomment write_enable=YES
uncomment chroot_local_user=YES

at last in file
user_sub_token=$USER
local_root=/var/www/html/

allow_writeable_chroot=YES
16) sudo adduser username
17) sudo chown username: username /var/www/html
18) sudo chmod a-w /var/www/html/
19) sudo chmod -R 0777 /var/www/html
20) sudo service vsftpd restart
21) sudo a2enmod rewrite
22) sudo service apache2 restart
23) sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf
sql_mode = ”
24) sudo vi /etc/php/7.0/apache2/php.ini
change upload_max_filesize = 2M -> upload_max_filesize = 50M
25) sudo service apache2 restart