Category Archives: MySQL

How To Install & Configure phpMyAdmin On Ubuntu 12.04 & Greater Versions?

phpMyAdmin is a free software that provides you a user friendly interface to work with MySQL on the web. It simply provides you a convenient visual frontend to access MySQL capabilities. This tutorial shows you the steps for installing phpMyAdmin on Ubunu Linux so before installing it make sure you must have root privileges on your virtual private server.

Continue reading How To Install & Configure phpMyAdmin On Ubuntu 12.04 & Greater Versions?

How To Grant Privilege To Any MySQL Database User ?

GRANT command is be used for giving privilege to any user for accessing database.

GRANT PRIVILEGES ON DATABASE OBJECTS TO USER@HOST IDENTIFIED BY ‘PASSWORD’;

Example:

For granting privilege to user  admin Use:

GRANT ALL PRIVILEGES ON *.* TO ‘admin@localhost’ IDENTIFIED BY ‘secret’;

For specifying the username and password which is used while staring MySQL is:

mysql –h hostname –u username –p password

When you don’t want users to access any other database tables then replace* (as shown below) with database name of that particular user whom you want to limit access to other database tables:

GRANT ALL PRIVILEGES ON ‘store’.* TO ‘admin@localhost’ IDENTIFIED BY ‘secret’;

Run given command with root permission. In the given command ‘store’ correlates to the name of database to which the privileges are assigned.

Listing MySQL Databases

For showing all database:

SHOW DATABASES;

In case you need to filter database by name:

SHOW DATABASES LIKE ‘pattern’;

For complex filtering of database use WHERE Clause:

SHOW DATABASES WHERE conditions;

With WHERE clause one can use regular expressions like ‘<‘ and ‘>’ operators, string functions etc. for filtering records returned by SHOW DATABASES.

One Command LAMP Server Installation

Installing LAMP Server

  • Open your Linux Terminal.
  • Type: sudo apt-get install lamp-server^
  • Press Enter

Checking the Installation

  • Open a web browser
  • Type: http://localhost/
  • If your browser shows the message: “It Works” then you have successfully installed LAMP

Tasksel Method

Other than the above given method you may use the Tasksel method for installing LAMP server. Use following given commands on your Linux Terminal:

sudo apt-get install tasksel
sudo tasksel install lamp-server

PhpMyAdmin

If you need to install PhpMyAdmin for managing your website’s database:

sudo apt-get install phpmyadmin