Archive for the ‘MYSQL’ Category

How to import large sql file (> 3MB) in wamp using phpMyAdmin

Normally phpMyAdmin imports sql files with less than 3 MB. To upload .sql files with more than 3 MB (usually in wordpress site) we have  to use a diffent method.

Step 1

Move to phpMyAdmin folder usually it is located in "C:\wamp\apps\phpmyadmin3.3.9". 

Step 2

Open config.inc.php file.

Find the code $cfg[‘UploadDir’] =''; and replace it with $cfg[‘UploadDir’] = 'upload';

Save config.inc.php file.

Step 3

Create a folder named upload into the phpMyAdmin folder ( C:\wamp\apps\phpmyadmin3.3.9 ).

Read more »

Install LAMP (Linux + Apache + MySQL + PHP ) in Ubuntu 12.10

LAMP stands for Linux, Apache, MySQL and PHP. This script installs those programs and packages at once easily in Ubuntu.

Press Ctrl + Alt + T on your keyboard to open the terminal. When it opens run the commands below to install the packages.
 
sudo apt-get install lamp-server^
 
During the installation, you’ll be prompted to create a password or MySQL server. Create one to continue.
 
Test 1 – Apache
 
After the installation, test Apache by opening your web browser and typing localhost. When you seen the screen below, it means Apache is functioning.
 

Install LAMP (Linux + Apache + MySQL + PHP ) in Ubuntu 12.10


Read more »

How to use GROUP BY and ORDER BY together in SQL

Step 1

First you need to create one table named employee with 9 fields.

CREATE TABLE employee (
 
    id int unsigned not null auto_increment primary key,
    firstname varchar(20),
    lastname varchar(20),
    title varchar(30),
    age int,
    yearofservice int,
    salary int,
    perks int,
    email varchar(60)
); 
 
Step 2
 
Insert some dummy values into the employee table
 
INSERT INTO employee (firstname, lastName, title, age, yearofservice, 
salary, perks, email) values ("James", "John", 
"Programmer", 31, 3, 120000, 25000, "jj@gmail.com");
 
INSERT INTO employee (firstname, lastName, title, age, yearofservice, 
salary, perks, email) values ("Joe", "Mathew", 
"Teacher", 42, 4, 186000, 32000, "jm@gmail.com");
 
INSERT INTO employee (firstname, lastName, title, age, yearofservice, 
salary, perks, email) values ("Jobin", "Thomas", 
"Programmer", 28, 1, 236000, 36800, "jt@gmail.com");

Read more »