Sandstorm Enterprises® : PhoneSweep® MySQL Fix
Sandstorm Enterprises®
PhoneSweep® MySQL Fix

Fixing "Cannot connect to MySQL" Message

When this message is encountered, it is extremely important to note which operating system is in use. The problem resolutions vary depending on the operating system.

PhoneSweep's components (user interface, engine and MySQL database) communicate via TCP/IP. To verify TCP/IP communication:

  • Open an MS-DOS window. (Do this via the Start menu on your computer.)
  • Type ping localhost
    You should get an answer that confirms this operation is working.
  • Type ping 127.0.0.1
    You should get an answer that confirms this operation is working.

If the ping attempts both succeed, continue to the section titled Cannot connect to MySQL message persists with proper TCP/IP setup at the end of this document. If the pings fail, you will get an answer saying that the computer could not perform the operation successfully. If any of the ping attempts fail, you must set up your system networking properly with TCP/IP. This is best done by speaking to your company's network or systems administrator. If you want to attempt this process yourself, these pages can guide you through the necessary steps.

If you can ping 127.0.0.1 but cannot ping localhost, skip to the section TCP/IP: Setting up LMHOSTS or HOSTS file. If neither ping attempt succeeds, proceed to the next section: TCP/IP: Setting Up a Dummy IP Address.


TCP/IP: Setting Up a Dummy IP Address

If your operating system is
Windows 98 or Windows 95:

  1. Open Start, then Settings, then Control Panel, then Add New Hardware.
  2. Click Next, then click Next again, then let it search.
  3. Select "No, the device isn't in the list", then click Next.
  4. Select "No, I want to select the hardware from a list", then click Next.
  5. Select "Network adapters" from the list, then click Next.
  6. Select "Microsoft" in the Manufacturer's column, "Microsoft Dialup Adapter" in the Network Adapter column. Proceed through the rest of the setup using defaults.
  7. Right-click on Network Neighborhood, select Properties.
  8. Select TCP/IP -> Dial-Up Adapter, click Properties.
  9. Click OK at the warning screen.
  10. On the IP Address tab, select "Specify an IP address", enter dummy values for IP address. A safe IP address to use is 10.0.0.2. Click OK.

If your operating system is
Windows 2000 or Windows NT:

  1. Open Start, then Settings, then Control Panel, then Add/Remove Hardware Wizard.
  2. Select Add/Troubleshoot a device, then click Next.
  3. Let it search, then select "Add a new device" at the top of the list, then click Next.
  4. Select "No, I want to select the hardware from a list", then click Next.
  5. Select "Network adapters" from the list, then click Next.
  6. Select "Microsoft" in the Manufacturer's column, "Microsoft Loopback Adapter" in the Network Adapter column, then click Next, then click Next again, then click Finish.
  7. Right-click on My Network Places, then select Properties.
  8. Right-click on Local Area Connection, then select Properties.
  9. Click on Internet Protocol(TCP/IP), then select Properties.
  10. Enable "Use the following IP address", and enter dummy values for IP address. A safe IP address to use is 10.0.0.2. Click OK.

If your operating system is
Windows XP:

  1. Open Start, then Settings, then Control Panel, then Add Hardware Wizard.
  2. Click Next to the Welcome to the Wizard screen.
  3. Select Yes, the hardware is already connected; click Next.
  4. Let it search, then select "Add a new device" at the top of the list; click Next.
  5. Select "Add a new device" (the last item).
  6. Let it search, then click Next.
  7. Select "Network adapters" from the list; click Next.
  8. Select "Microsoft" in the Manufacturer's column, "Microsoft Loopback Adapter" in the Network Adapter column; click Next; click Next again. Click Finish.
  9. Right-click on My Network Places; select Properties.
  10. Right-click on Local Area Connection; select Properties.
  11. Click on Internet Protocol(TCP/IP); select Properties.
  12. Enable "Use the following IP address", and enter dummy values for IP address. A safe IP address to use is 10.0.0.2. Click OK.

Attempt to run PhoneSweep. If it runs properly then this process is complete. If PhoneSweep does not run and continues displaying the message "CANNOT CONNECT TO MYSQL", continue with the next section, TCP/IP: Setting up LMHOSTS or HOSTS file. If you get a different failure message, contact Sandstorm for further support.


TCP/IP: Setting up LMHOSTS or HOSTS file

  1. Check your operating system:
    • If it is Windows 95, Windows 98, or Windows XP, contact Sandstorm for assistance.
    • If it is Windows 2000 or Windows NT continue with the following steps:
  2. Determine which file your system uses: LMHOSTS or HOSTS by performing these steps:
    • Go to the directory C:\Winnt\System32\Drivers\etc\
    • View the directory's extensions by selecting Details from the View menu.
      • If no files appear, they are "hidden" by the operating system defaults. You will need to unhide them to perform the steps in the rest of this section. Contact your system administrator or internal help desk for information on how to unhide your system files and rehide them after completing the steps in this document.
    • In that directory, you may see one or more of these four files, probably not all four.
      • HOSTS
      • HOSTS.SAM
      • LMHOSTS
      • LMHOSTS.SAM
    • Using your system's Find Files command (available via the Start menu), search for the text "127.0.0.1".
    • The line
      127.0.0.1             Localhost
      (that's "127.0.0.1 (tab) Localhost") should either be in your HOSTS or LMHOSTS file, depending on which one your system has been set up to use. Note in which of these two files you found this line.
    • If neither file has that line, look for that line in the HOSTS.SAM file or LMHOSTS.SAM.
      • If it's in HOSTS.SAM, rename the file HOSTS.SAM to HOSTS.
      • If it's in LMHOSTS.SAM, rename the file LMHOSTS.SAM to LMHOSTS.
    • If the line doesn't exist in any of the four files, create a HOSTS file and place that one line in the file. Save it as a "plain text" or ASCII file (depending on what application you used to create the file), and exit. The file can be created using Notepad.

    Note that whichever file you use, HOSTS or LMHOSTS, it should not have an extension.

  3. Check for correct LMHOSTS / HOSTS setup:
    • Perform the following appropriate steps for your operating system.


    • In Windows 2000:
      • Right-click on My Network Places, select Properties
      • Right-click on Local Area Connection setup, select Properties.
      • Click on Internet Protocol TCP/IP, select Properties.
      • Select Advanced.
      • Select WINS tab.
      In Windows NT:
      • Right-click on Network Neighborhood, select Protocols.
      • Select TCP/IP.
      • Select Properties.
      • Select Advanced.
      • Select WINS tab.
    • Examine Enable LMHOSTS lookup checkbox.
      • If you have the "127.0.0.1 (tab) Localhost" line in the LMHOSTS file, the checkbox should be checked.
      • If the above line is in the HOSTS file, the checkbox should NOT be checked.
    • Note: if you are using Windows NT, you may be prompted to enter an IP address. A safe dummy IP address to enter is 10.0.0.2.
    • Once you have examined the "Enable LMHOSTS lookup" box and set it to the proper checked/unchecked setting, Click OK on all the windows until you exit all windows.

  4. Run PhoneSweep and see if you still get the CANNOT CONNECT TO MYSQL message.

CANNOT CONNECT TO MYSQL message persists after setting "Enable LMHOSTS lookup"

If you are using the HOSTS file: If you are using the LMHOSTS file:

Restart PhoneSweep. If PhoneSweep still gives a CANNOT CONNECT TO MYSQL message, you may need to set up a dummy IP Address. Refer to the section TCP/IP: Setting Up a Dummy IP Address earlier in this document for further troubleshooting.


CANNOT CONNECT TO MYSQL message persists with proper TCP/IP setup

  • If your operating system is Windows NT, or Windows 2000 without Service Pack 2, contact Sandstorm Enterprises.
  • If your operating system is Windows 2000 with Service Pack 2, perform the following steps:
    1. If you have PhoneSweep open, exit it.
    2. Browse to the directory where you installed PhoneSweep, normally
      C:\Program Files\Sandstorm\PhoneSweep\
    3. Browse to the dbm\bin directory under that.
    4. Rename the file mysqld.exe to mysqld_old.exe.
    5. Copy the file mysqld-opt.exe to mysqld.exe.
    6. Exit all directories (close all windows).
    7. Restart PhoneSweep.

If you are still having problems, contact Sandstorm Enterprises.


Sandstorm's Products
Order / Get a Quote
Contact Us
Back to top
Sandstorm Enterprises develops
tools with sharp edges®
for information security professionals.
Site materials © 1998 - 2008 Sandstorm Enterprises, Inc. The Sandstorm logo®, LANWatch®, NetIntercept®, PhoneSweep®, Sandtrap®, TCP.demux™, Single Call Detect™, Tools with sharp edges®, Rapid Event Analysis™, and Sandstorm Enterprises® are all trademarks or registered trademarks of Sandstorm Enterprises, Inc.