Salesforce.com can connect to REST- and SOAP-enabled database servers. Unfortunately, older database servers, such as MySQL, do not support these modern protocols, instead depending on drivers and binary software libraries to expose their interfaces. ODBC is another common example of a "pre-Internet" protocol-- it relies on the existence of system drivers to provide the interface.
This means that, ultimately, any solution with Apex Code requires a middle-man approach. PHP can connect to MySQL and ODBC drivers, for example, so it would be possible to set up a server running PHP that can listen for incoming requests, translate the incoming request into a format that the other database system can understand, execute the command, then return the results back in REST or SOAP format (depending on the exact configuration of PHP code).
At the time of this answer, a cursory search on several popular search engines suggest that there is no open-source solutions written in PHP (or Perl, Ruby, ASP, JSP...) that addresses this need. However, there is an abundance of data on the Internet on how to write various scripts in any modern server scripting language, so it would simply be a matter of stitching that information together into a single coherent script.
I've tried this in my development org
String term = 'Burlington Textiles Corp of America';
List<Account> records = [Select Active__c From Account where Name like :(term + '%') order by Name limit 5];
It works fine for me, is there something odd in your 'term' value?
Some things to try...
Avoid the concatination in the SOQL...
String termForSOQL = term + '%';
List<Account> records = [Select Active__c From Account where Name like :termForSOQL order by Name limit 5];
Add the following to see 'term' value...
System.debug(term);
Also try ....
List<Account> records =
[Select Active__c From Account where Name like :'Burlington Textiles Corp of America%')
order by Name limit 5];
(e.g. without the variable)
Bottom Line. Basically this should not be happening normally, you've encountered a Salesforce platform bug. You should make a small peace of Apex like the above with the value of 'term' hard coded and report the issue to Salesforce support. My guess is there is something special, a special character or so? Also tell Salesforce what your Org Id is.
Best Answer
You cannot run SQL queries against Salesforce, only SOQL.
If you want to use SQL then you can export data from Salesforce and import it into your SQL database. This can be done using the DataLoader for a one off or ad-hoc analysis. Or you can use a replication tool like Informatica to automate this.