phpMyAdmin

phpMyAdmin installation in Linux server:

===============================

phpMyAdmin is a web-based tool used to manage databases.

1. Pre requisites:

* Ensure PHP installed in the server is PHP 5 or above. PHP version can be checked using the command given below.

====
php -v
====

* Ensure Mysql version installed in the server is Mysql 5 or above. Mysql version can be checked using the command given below.

====
mysql -V
====

2. Download and Install phpmyadmin in Apache DocumentRoot

Source download:
====
http://www.phpmyadmin.net/home_page/index.php
====

cd /usr/local/apache/htdocs
tar xvfz phpMyAdmin-3.3.7-all-languages.tar.gz
mv phpMyAdmin-3.3.7-all-languages phpmyadmin

3. Secure the phpmyadmin Directory – Create phpmy user

Create phpmy Unix user.

===
adduser phpmy
passwd phpmy
===

4. Check which user and group is used by Apache:

egrep ‘User|Group’ /usr/local/apache/conf/httpd.conf
User nobody
Group nobody

5. Modify the phpmyadmin directory’s user ownership to phpmy user.

cd /usr/local/apache/htdocs
chown -R phpmy.nobody phpmyadmin/

6. Update phpMyAdmin config.inc from Wizard:

=====
cd /usr/local/apache/htdocs/phpmyadmin/
mkdir config
chmod o+rw config
cp config.sample.inc.php config/config.inc.php
chmod o+w config/config.inc.php
=====

Now, invoke the phpMyAdmin setup wizard from the browser using the URL: http://{your-ip-address}/phpmyadmin/setup/index.php and the follow the installation steps.

 

To familiarise yourself with databases in phpMyAdmin, first login to phpMyAdmin and then follow this guide.

============================================================

1. From the first screen, you will have access to your databases, which are listed on the left.

2. Clicking a database name will show a list of tables in the database on the left and more detailed information on the right.

3. In the Action section, you can click ‘Browse’ to see the individual records in a table.

4. Click ‘Structure’ to view a tables structure and perform several actions.

5. Click ‘Search’ to search using specific keywords.

6. Click ‘Insert’ to add new rows (or fields) to the table.

7. Click ‘Empty’ to delete the contents of a table.

8. Click ‘Drop’ to delete the whole table and its contents.

9. Click a table on the left to view the structure of the table’s fields.

Note: For further help with phpMyAdmin click the ‘Question Mark’ icon on the left hand side.

Note: For further help with SQL click the ‘SQL’ icon on the left hand side.

Copying a Database Table with phpMyAdmin

To copy a database table in phpMyAdmin, first login to phpMyAdmin and then follow this guide.

1. In the left hand side, click the database table you wish to copy, then click the ‘Operations’ button.

Note: When copying a table, you have the option to copy the table structure only, the data or both.

2. Enter a name for the copy, as copying actually creates a new table.

3. Select the option for table structure, data or both and click ‘Go’

4. The new table will appear on the left  and will be an exact copy of the original with a new name.

Note: For further help with phpMyAdmin click the ‘Question Mark’ icon on the left hand side.

Note: For further help with SQL click the ‘SQL’ icon on the left hand side.

Creating Tables in a Database with phpMyAdmin

To create tables in a database in phpMyAdmin, first login to phpMyAdmin and then follow this guide.

1. Click the database on the left, which you wish to create tables in.

2. Enter the name for your new table in the ‘Name’ text box.

3. Enter the number of fields for the table in the ‘Number of Fields‘ box and click ‘Go’

4. Enter the details for each field within the new table.

Note: The first field is normally called ‘id’, is an ‘Integer’ field and holds the ‘Primary Key’ for the table’

5. When you have filled in the details click ‘Save’ and the table will be created and appear on the left hand side under the database name.

Note: For further help with phpMyAdmin click the ‘Question Mark’ icon on the left hand side.

Note: For further help with SQL click the ‘SQL’ icon on the left hand side.

Deleting Fields from Database Tables with phpMyAdmin

To delete fields from database tables in phpMyAdmin, first login to phpMyAdmin and then follow this guide.

1. Select the database on the left hand side which contains the table where you wish to delete the fields.

2. Click on the table in the left hand side that you wish to delete the fields from.

3. Select the field to delete and click the ‘Delete’ icon and click ‘Yes’ to confirm the deletion.

Note: For further help with phpMyAdmin click the ‘Question Mark’ icon on the left hand side.

Note: For further help with SQL click the ‘SQL’ icon on the left hand side.

Deleting Tables in a Database with phpMyAdmin

To delete tables in a database in phpMyAdmin, first login to phpMyAdmin and then follow this guide.

1. Select the database on the left hand side which contains the table to delete.

2. Click on the table in the left hand side that you wish to delete.

3. You can delete individual fields by selecting the field and clicking the ‘Delete’ icon.

4. To delete the whole table, click the ‘Drop’ icon and then click ‘OK’ to confirm the deletion.

Note: For further help with phpMyAdmin click the ‘Question Mark’ icon on the left hand side.

Note: For further help with SQL click the ‘SQL’ icon on the left hand side.

Exporting Databases and Tables with phpMyAdmin

To export databases and tables in phpMyAdmin, first login to phpMyAdmin and then follow this guide.

1. To export a database, select it on the left hand side and click the ‘Export’ icon.

2. To export the whole database as a back up, select ‘SQL’ as the format.

Note: Ensure you check any options you require before proceeding with the export.

3. Check the ‘Save as File’ box, then click ‘Go’ and click ‘Ok’ to export the database to your hard drive.

4. To export a table, select it on the left hand side and click the ‘Export’ icon.

5. Check the ‘Save as File’ box, then click ‘Go’ and click ‘Ok‘ to export the table to your hard drive.

Note: For further help with phpMyAdmin click the ‘Question Mark’ icon on the left hand side.

Note: For further help with SQL click the ‘SQL’ icon on the left hand side.

Importing Databases and Tables with phpMyAdmin

To import databases and tables in phpMyAdmin, first login to phpMyAdmin and then follow this guide.

1. To import a saved database if a table in the existing copy is corrupt, select the database on the left hand side.

2. Select the corrupt table and click the ‘Delete’ icon, click ‘OK’ to confirm the deletion.

3. Click ‘Import’ and browse to the saved database copy on your PC and click ‘Open’

4. Click ‘Go’ and your saved copy will be imported overwriting your existing one.

Note: For further help with phpMyAdmin click the ‘Question Mark’ icon on the left hand side.

Note: For further help with SQL click the ‘SQL’ icon on the left hand side.

Inserting Fields into Database Tables with phpMyAdmin

To insert fields into database tables in phpMyAdmin, first login to phpMyAdmin and then follow this guide.

1. Select the database on the left hand side which contains the table where you wish to add the fields.

2. Click on the table in the left hand side that you wish to add fields to.

Note: You can add fields at the beginning and end of a table or after an existing field.

3. Enter the positon in the table of the new field (remember to select the correct field in the drop down, if you wish to add the field after an existing one.)

4. Click ‘Go’ and then enter the details of the new field and click ‘Save’ when finished.

Note: For further help with phpMyAdmin click the ‘Question Mark’ icon on the left hand side.

Note: For further help with SQL click the ‘SQL’ icon on the left hand side.

Modifying Fields in Database Tables with phpMyAdmin

To modify fields in database tables in phpMyAdmin, first login to phpMyAdmin and then follow this guide.

1. Select the database on the left hand side which contains the table where you wish to modify the field.

2. Click on the table in the left hand side that contains the field to modify.

3. Select the field to modify and click the ‘Change’ icon.

4. Make the changes you require to the field and click ‘Save’ to complete the modification.

Note: For further help with phpMyAdmin click the ‘Question Mark’ icon on the left hand side.

Note: For further help with SQL click the ‘SQL’ icon on the left hand side.

Renaming Database Tables with phpMyAdmin

To rename database tables in phpMyAdmin, first login to phpMyAdmin and then follow this guide.

1. Click the database table in the left hand side that you wish to rename.

2. Click the ‘Operations’ button.

3. Enter the new name for the table and click ‘Go’ to save the changes.

Note: For further help with phpMyAdmin click the ‘Question Mark’ icon on the left hand side.

Note: For further help with SQL click the ‘SQL’ icon on the left hand side.

Running SQL Queries on a Database with phpMyAdmin

To run SQL queries on a database in phpMyAdmin, first login to phpMyAdmin and then follow this guide.

1. Click the database on the left hand side that you wish to run the SQL query on.

2. Click the ‘SQL’ icon and enter your SQL query in the text box.

3. An example would be to delete a field from a table using SQL, enter the following query.

4. ALTER TABLE ‘enter the name of your table containing the field here’ DROP ‘enter the field name here’

Note: Remember to include the ‘ in the query

5. Click ‘Go’ and ‘OK’ to execute the SQL command.

6. Click the database table on the left hand side and you will see the field you nominated has been deleted.

7. You can also click the ‘SQL’ icon in the table view which will give you a partially completed SQL query.

Note: For further help with phpMyAdmin click the ‘Question Mark’ icon on the left hand side.

Note: For further help with SQL click the ‘SQL’ icon on the left hand side.

Searching through a Database with phpMyAdmin

To search through a database in phpMyAdmin, first login to phpMyAdmin and then follow this guide.

1. Select the database on the left hand side and then click the ‘Search’ button.

2. Enter words or values to search for in the text box.

3. Select the options to refine your search.

4. Select the table or tables that you wish to search in the database and click ‘Go’ to start the search.

5. Click ‘Browse’ to view the record(s) that were found.

6. You can now make changes to the record if required by selecting it and clicking the ‘Change’ icon.

7. When you have completed any changes click ‘Go’ to save them.

Note: For further help with phpMyAdmin click the ‘Question Mark’ icon on the left hand side.

Note: For further help with SQL click the ‘SQL’ icon on the left hand side.

Advertisements
  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: