MySQL
  Home arrow MySQL arrow MySQL Table Prefix Changer Tool in PHP
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
MYSQL

MySQL Table Prefix Changer Tool in PHP
By: Nilpo
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 18
    2008-01-02


    Table of Contents:
  • MySQL Table Prefix Changer Tool in PHP
  • Constructing the tool
  • Editing your current database tables
  • Putting the database back together

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    MySQL Table Prefix Changer Tool in PHP
    ( Page 1 of 4 )

    If you are a web developer, you are undoubtedly aware that there are constant threats to your site. SQL injections are one type of threat that you must be aware of and make every attempt to prevent.

    In a SQL injection, a malicious user is able to execute queries against your database through form fields on your web site.  In some cases, they are even able to append them as POST data directly in the address bar.

    This is especially a risk when you are running publicly available software packages such as phpBB.  Most users do not change the default settings, so once a vulnerability is exposed, malicious users are able to target sites running the software much more effectively.

    I’ve used phpBB as an example because it is well-known for its security vulnerabilities.  Sites running phpBB often become the target of SQL injection attacks.  Of the many ways to secure a phpBB installation, one of the most effective is to change the MySQL table prefixes away from the defaults set by the phpBB installer.

    This makes it that much harder for malicious users to effectively target your database.  While this in and of itself does not prevent SQL injections or increase your site’s security, it does make these attacks far less effective.

    While I designed this tool with this purpose in mind, it doesn’t stop there.  Perhaps you are migrating a site from one host to another and you need to change table prefixes as a result.  Or maybe you are restoring data from an old backup into a new installation that uses different settings from the previous.

    In any case, changing these prefixes can be a tedious job if you had to do it manually. Even tools like phpMyAdmin don’t provide a clean, quick method of doing this. But with a little help from PHP, we are able to create our own tool very quickly.



     
     
    >>> More MySQL Articles          >>> More By Nilpo
     

       

    MYSQL ARTICLES

    - Null and Empty Strings
    - MySQL Server Tuning Tips and Tricks
    - MySQL Query Optimizations and Schema Design
    - MySQL Benchmarking Tools and Utilities
    - MySQL Benchmarking Concepts and Strategies
    - Take Some Load off MySQL with MemCached
    - MySQL Table Prefix Changer Tool in PHP
    - Using the SIGNAL Statement for Error Handling
    - Error Handling Examples
    - Error Handling
    - Completing a Search Engine with MySQL and PH...
    - Paginating Result Sets for a Search Engine B...
    - Building a Search Engine with MySQL and PHP 5
    - Using Boolean Operators for Full Text and Bo...
    - PHP, MySQL and the PEAR Database





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT