SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict dr_dumb99's Avatar
    Join Date
    Sep 2004
    Location
    Pakistan
    Posts
    304
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question String Search In Whole Database

    Hi!
    I want to search a string in whole database [not in a table]? Is it possible in MYSQL? If so then how?

    Thanks in advance

  2. #2
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    no.

  3. #3
    SitePoint Member
    Join Date
    Mar 2010
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use mysqldump to dump the database into a text file, like this:
    Code:
    mysqldump.exe databasename -u username -p > "c:\databasedump.sql"
    Then search using a good text editor.
    If you're on linux, you can pipe the output to grep and/or awk and all that stuff too.

    PS: this will only work if the string is cleartext. (not encrypted or encoded in a strange way)

  4. #4
    SitePoint Member
    Join Date
    Mar 2010
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As it looks like this topic has been bumped I'll add another way of doing this.

    I have written a PHP script which allows you to find and replace (or just find) any text string across a complete MySQL database. You can view/downlaod the code here:

    http://www.mjdigital.co.uk/blog/sear...ysql-database/

    I am working on a way to incorporate Wildcards and regular expressions - if you're desperate for that functionality then let me know.

    MJ7


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •