Extract EMail addresses From a MySQL Database Using phpMyAdmin

November 24th, 2011 by admin Leave a reply »

I wanted to send out a newsletter to all of my clients. So I can use WHM/cPanel or THT(billing system) to send them out. But it is possible that the emails would not reach it’s destinations. Or it is possible that I end this up with blacklisting my server’s IP address.

So I needed another solution and came up with sending the emails through MailChimp – A professional EMail marketing service. So they will handle everything and I will have a complete report of the EMails I send out.
But the thing is, I didn’t had all the email addresses of my clients anywhere except for the database of my billing system. And when I try to export the MySQL database to a local file and import emails through it ended up failure. Because there are more fields in the MySQL table rather than emails itself.

There is a possible way to extract only the emails from a MySQL database. That is to use phpMyAdmin to execute a custom query to display only emails and export the view.
This is how you can do that.

  1. Login to phpMyAdmin
  2. Select the database and choose the table which contains the email addresses. Click on the Browse button.
  3. Click on SQL and execute the following command.
    SELECT 'email' FROM `your_table`
    email should be replaced with the name of the field which contains email addresses while your_table should be replaced with the table name which contains email addresses and other information.
    Usually, it is already set. So you won’t need to change a thing except for email.
  4. Click on Go and phpMyAdmin will show a view that contains only the email addresses.
    phpMyAdmin Screenshot
  5. Click on the link Export at the bottom of the page. Not the Export in the Tab bar.
  6. Export it as your desire. Personally, I like to have an .CSV file.

From this method followed, you will have a CSV file which contains all the email addresses from your users.
It is possible to use the same method to extract email addresses from your forum, wordpress blog or any other MySQL database which contains email addresses. Just be sure you won’t use them to spam your users.

Advertisement

Leave a Reply

Human Verification: In order to verify that you are a human and not a spam bot, please enter the answer into the following box below based on the instructions contained in the graphic.