Showing posts with label MySQL. Show all posts
Showing posts with label MySQL. Show all posts

Saturday, September 10, 2016

How to install Apache, MySQL and PHP in Ubuntu

  1. Open terminal
  2. Type

    sudo apt-get update
    sudo apt-get install apache2

    sudo apt-get install mysql-server

    sudo apt-get install php libapache2-mod-php php-mcrypt php-mysql

    sudo systemctl restart apache2
Source: https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-16-04

Tuesday, September 6, 2016

How to restore MySQL dump/backup?

  1. Open the Command Prompt (Windows)/Terminal (Linux)
  2. Go to the folder where it is the MySQL dump/backup file
  3. Type the following command:

    mysql -u {username} -p{password} -h{host} {databaseName} < {backup-name}.sql
{username} is the login that has access to connect to the database
{password} is the login's password
{host} is the server name where it is the database
{databaseName} is the database name
{backup-name} is the name back up file name

Example:

I want to restore the Meemaw.sql dump/backup file to the BAZINGA database located at the TheBigBangTheory host with the user name Sheldon and password Cooper.

mysql -u Sheldon -pCooper -h TheBigBangTheory BAZINGA < Meemaw.sql

Source: http://www.thegeekstuff.com/2008/09/backup-and-restore-mysql-database-using-mysqldump/

Wednesday, September 30, 2015

How to backup a single MySQL database?

  1. Open the Command Prompt (Windows)/Terminal (Linux)
  2. Type the following command:

    mysqldump -u {username} -p{password} -h {host} {databaseName} > {backup-name}.sql
{username} is the login that has access to connect to the database
{password} is the login's password
{host} is the server name where it is the database
{databaseName} is the database name
{backup-name} is the name back up file name

Example:

I want to backup the BAZINGA database located at the TheBigBangTheory host with the user name Sheldon and password Cooper and save it on Meemaw.sql  file.

mysqldump -u Sheldon -pCooper -h TheBigBangTheory BAZINGA > Meemaw.sql

Source: https://www.linode.com/docs/databases/mysql/back-up-your-mysql-databases