Tag Archives: mysql

mariadb logo

MariaDB – An Alternative to MySQL

MariaDB is an Enhanced and Binary Drop In replacement (equivalent) for MySQL. It’s a completely free and open source software, available under GPL/LGPL/BSD. Most importantly, moving from MySQL to MariaDB is seamlessly easy (you rarely need to change anything, just uninstall MySQL and install MariaDB, Voila! you’re ready to go, read on more about the compatibility).

mariadb logo

Why Choose MariaDB over MySQL ?

  • Additional Storage Engines (Aria, XtraDB, Cassandra etc)
  • Speed Improvements (faster joins and subqueries, optimizer enhancements etc)
  • New features and extensions (e.g virtual columns, dynamic columns, pluggable authentication etc)
  • Improved Testing suite
  • Truly open source (as compared to some closed modules in MySQL Enterprise edition)

To know more about the MariaDB, visit the official website : https://mariadb.org/

Apache on Ubuntu

how to install LAMP – Apache, MySQL & PHP on Ubuntu 11.10

Ubuntu has become popular not only among desktop users but also among the web developers who uses Linux distribution to deploy their web application (on a VPS or dedicated host), although they preferred to use LTS (Long Term Support – typically of five years for Server Edition) version rather than a regular stable release because of obvious advantages – increased stability (Although, from the next release i.e Ubuntu 12.04 LTS, Desktop version will also get 5 years of support).

Despite of that fact, a lot of users/developers also use Apache server on their localhost for testing/development (e.g wordpress developers use it) and this post is written for those who want to get started with Apache, PHP, MySQL, phpMyAdmin etc with Ubuntu 11.10. Apache is the most popular web server on this planet (total share is above 65%). It is an open source and cross-platform web server. Apache supports a lot of server side language and the features is extensible using modules. PHP dominates the web scripting world and MySQL is the most popular open source database. Most of the websites (including the blog – you’re reading right now) are based on the great combination of Linux, Apache, MySQL and PHP (Commonly called as LAMP).

Setup LAMP in Ubuntu 11.10

step 1. Installing Apache

Apache on UbuntuOpen terminal (press Ctrl+Alt+t) and execute the command –

sudo apt-get install apache2

The above command will install some default modules, packages and libraries but you later install the ones you need. When installation is completed, type the address http://localhost in the browser address bar and you will get a default apache page like this –



MySQLstep 2. Installing MySQL

Execute the command –

sudo apt-get install mysql-server

and enter the root password during installation procedure. I’ve already covered a post in detail about how to install MySQL on Ubuntu 11.10.

step 3. Installing PHP

Execute the command –

sudo apt-get install php5 libapache2-mod-php5 php5-mysql

Then restart the Apache server to load php modules –

sudo /etc/init.d/apache2 restart

To test whether the PHP 5 has been successfully installed or not, create a file phpinfo.php and copy the following content (to the file) –

print_r (phpinfo());

and put the file in root web directory (/var/www). Then open the address http://localhost/phpinfo.php, then it should display the php configuration details like this –

testing php on Ubuntu

That’s All.. Linux (Ubuntu is itself a Linux based OS), Apache, MySQL and PHP i.e all the components of LAMP has been installed successfully.

To manage MySQL database from a GUI, You may like to install phpMyAdmin – The MySQL web administration tool, a great application for managing – creating and maintaining MySQL database.

How to install phpMyAdmin on Ubuntu 11.10 ?

just execute the command –

sudo apt-get install phpmyadmin

When the installation is complete, move on to http://localhost/phpmyadmin and login (using the MySQL login username(default is ‘root’) and the password (you entered during installation)) to start using it.

Want to learn web server administration (with LAMP) on Ubuntu Server ?

Having apache, MySQL, PHP installed locally on your system is good for learning about the server administration and other cool/great stuffs related to Linux but VPS is very cheap these days so you may want to try Ubuntu (with Apache or other web server) on a VPS for much better (and real) experience – I’ve been using Linode VPS @ $19.95/month (512 MB RAM, 20 GB space and 200GB bandwidth) for a while, and I am loving it.


how to install MySQL server on Ubuntu 11.10

MySQL is one of the most popular open source Relation Database Management System (RDBMS), used very widely developing database based Applications – it’s specifically very popular in web development (The blog – you’re reading right now, is based on wordpress, which also uses MySQL databases for storing contents such as post, category, comments, and other meta data). Since Ubuntu (11.10 beta 2 – latest version, final is coming within few weeks) has now become the most popular choice for application development, LAMP (Linux, Apache, MySQL and PHP).

most popular open source RDBMS

In Ubuntu 11.10 (based on Gnome 3), synaptic package manager has been removed so you can use Ubuntu Software Center or terminal (or install synaptic package manager in Ubuntu 11.10 (Oneiric Ocelot) if it’s you favorite application for managing application – although due to some major improvements in Ubuntu Software Center you might not need it anymore).

In Ubuntu or any other Linux based systems there are lot of other database programs are also available such as SQLite, mongoDB, H2, CouchDB, etc but MySQL is probably the most reliable, fast and powerful database – although it depends on the type of application or your interest.

 Installing MySQL in Ubuntu 11.10 – Oneiric Ocelot

I prefer Terminal for managing applications, as I think it’s very handy, although installing new softwares/Apps from Software center is also very simple – just search for the mysql server meta package (if you don’t know the actual name of the package then search using name of equivalent proprietary software, e.g if you search for Photoshop then you will get GIMP) which will automatically select the latest version and click on Install button….and wait for the download/installation procedure to finish and you’re done!

1. Open a terminal (Ctrl+Alt+t) and execute the following command(s)

sudo apt-get install mysql-server

2. During the installation process – you will be prompted to set the password for root user (for MySQL server).


Then, enter the password again (for confirmation) and the installation process will complete within a minute.


3. That’s All..you’re successfully installed the mysql server, client and other dependent packages successfully.

Login to MySQL Server in Ubuntu @localhost

using mysql-server in localhost

Now, you’ve mysql program installed on your computer, you can start creating databases, tables, users ..whatever you want! Login using terminal or install a query browser tool (search in Software Center). In terminal execute the command –

mysql -u root -h localhost -p

Then enter your root password (you entered during installation – step#2 ) and you will get the mysql prompt.


Just for testing purpose, lets create a database. Execute the following commands –

create database forfun;
show databases;

Have Fun!


how to install phpmyadmin on ubuntu 11.04/10.10

phpMyAdmin is a MySQL web administration tool, which allow us to administrate MySQL database in graphical interface (from your browser) and available for Ubuntu 11.04 (natty narwhal) or 10.10 (Maverick Meerkat) or 10.04 (Lucid Lynx) or any other Linux distros. Since phpMyAdmin is written in PHP (Hypertext Preprocessor (Surprised! it’s a recursive acronym), The most popular scripting language, used for server side processing); of course it’s an open source (and Free!) and cross platform application, so you can also use it on Windows NT based operating system such as Windows XP or 7; or Mac OS X.

phpMyAdmin is specially useful for beginners because it allows them to create, modify, delete or update – tables, field and rows, users permissions and settings etc in much simpler (as compared to command line interface) way. For Ubuntu phpmyadmin is the best (probably) tool for managing and controlling MySQL database.


What You can do with phpMyAdmin ?

  • browse databases and tables
  • “create, copy, rename, alter and drop” tables and databases
  • perform table maintenance
  • execute SQL statements/queries
  • manage MySQL users and privileges
  • search globally in databases
  • create and read dumps of tables or databases …

Installing phpMyAdmin on Ubuntu 10.04/10.10/11.04

Open Terminal (CTRL+ALT+T) and type the following command(s) to install phpMyAdmin (on your computer running Ubuntu or other debian based Linux distribution). Remember you need to install MySQL and Apache first, see there – installing mysql on ubuntu 11.04 or install Apache server on ubuntu. or installing php on ubuntu; more simply install the LAMP (Linux+Apache+MySQL+PHP) package from synaptic package manager. Then phpmyadmin : –

sudo apt-get install phpmyadmin

Alternative Method : Open Synaptic package manager, search for ‘phpmyadmin’, check the box for installation and click on Apply button (don’t forget to select yes for dependencies, I mean dependent libraries or program) to install the selected programs.

Login to phpMyAdmin to start administrating MySQL

Open any browser such as Google Chrome or Mozilla Firefox and type the following URL in the address bar (or click here )


Then, you will get a window like this –


Next, enter the login information – i.e MySQL username and password

>> ‘root’ as username

>> ‘password’ as the password that you entered while installing MySQL

That’s all..Now you are ready to rock with phpMyAdmin.

Recommended References :

Read official Documentation about phpMyAdmin


How to install MySQL on Ubuntu 11.04

MySQL is the most popular database, mostly used in developing database driven websites or in other words web Applications (Web Apps or Apps). it’s Free and open source. MySQL is a Relational Database Management System (RDBMS), that runs like a server and serves the requests (usually CRUD (Create, Retrieve, Update, Delete) operations) from the clients.

On Ubuntu 11.04 (Alias : Natty Narwhal) , if you want to use any database server, then of course MySQL is the best choice. This post will guide you in installing MySQL server/client (current version : 5.1) from Synaptic Package Manager or Command Line. In last I’ll also show you, how to connect to the MySQL database at the Terminal/shell, although you can also install use graphical tool to manage MySQL database – e.g MySQL Query Browser, MySQL Administrator or phpMyAdmin. MySQL is very popular in the combination of : LAMP – Linux, Apache, MySQL and PHP.

Installing MySQL Server on Ubuntu 11.04

From Synaptic Package Manager

#1 : Open Synaptic Package Manager and search for ‘mysql’. Then select (check the box) the mysql server 5.1 to install. If you want to install some other packages, then click on yes, if it asks for dependencies.


#2 : Then click on Apply and wait for the installation to complete.

#3 : In the , middle of the installation you will be prompted to Enter the MySQL ROOT Password. Enter a good password for that, but remember!, you need this password to manage the MySQL databases and users, so don’t forget!!

mysql root password

#4 : Relax, until the installation is complete.

From Terminal

sudo apt-get install mysql-server

Now you can connect to MySQL server using the command (In the example the Server Address : localhost, Username : root) –

mysql -h localhost -u root -p

Then Enter your Password (ROOT Password, that you entered in step #3) to connect to the server running at localhost.

Connecting to MySQL server