MySQL for Ubuntu Quickstart Guide

Installing MySQL for Ubuntu

From the Ubuntu desktop:

  1. Go to System > Administration > Synapatic Package Manager
  2. Search for “mysql-server” and “Mark for installation”
  3. Click on the “Apply” to install

From the command line:

$ sudo apt-get install mysql-server

Setting a Password for the MySQL Root User

By default the MySQL installation doesn’t have the password set for root. To set the password at the unix prompt:

$ mysqladmin -u root password <password>

Creating a Database in MySQL

Login into MySQL as root and in the prompt type:

mysql> CREATE DATABASE <database name>

Granting Privileges in MySQL

In the MySQL prompt:

mysql> GRANT <what to grant> ON <database name>.* TO '<username>'@'<hostname>' IDENTIFIED BY '<password>'

Backing Up Your Database

Use the mysqldump command line:

$ mysqldump <database name>

To backup more than one database:

$ mysqldump --databases <database 1> <database 2>

To backup all the databases:

$ mysqldump --all-databases

Restoring Your Database

$ mysql -u <username> -p <database name> < <database backup file>

Related posts:

  1. Problem using MySQL JDBC on Tomcat 5.5 and Ubuntu 8.04
  2. OpenSSH for Ubuntu Quickstart Guide
  3. Drupal Quickstart Guide
  4. Ubuntu Quickstart Guide
  5. Samba on Ubuntu Quickstart Guide
This entry was posted in MySQL, Ubuntu and tagged , . Bookmark the permalink.

Comments are closed.