First, using Linux is nearly allways faster than windows. But that's probably not the problem here.
In your queries you are using the LIKE operator a lot, but without a real search term.
Normally a LIKE query would look like this:
SELECT *
FROM table
WHERE col1 LIKE '%find me%'
This will return all rows where col1 contains 'find me' anywhere in the data.
so it will find 'hello, I dare you to find me' and 'find me if you can'
In your case you do:
SELECT *
FROM table
WHERE col1 LIKE 'find me'
which will only find records where col1 contains exactly 'find me'
In that case, it's much faster to use the '=' operator:
SELECT *
FROM table
WHERE col1 = 'find me'
Also, you don't have to put quotes around numerical values:
SELECT *
FROM table
WHERE col1 = 2;
not even if the 2 is put in there using a variable:
SELECT *
FROM table
WHERE col1 =$iMyValue
Third, making things a bit more complex to newbies:
Indexes.
Your database can use indexes just like you use the index of a book to quickly find which page some information is on.
Grab the mysql manual from www.mysql.com and read the section on indexes to get more information.
Indexes are_great speed for performance.
if you don't use indexes, then every query will force a 'sequencial scan'.
That means that for every query, the DBMS is forces to read all_ rows in the table, even if it only needs to find one row.
As you can imagine, that slows you down drastically.
Try to create indexes on all columns that you query, preferably on combinations of columns that are also combined in the query:
SELECT *
FROM table
WHERE col1 = 2 AND col2=65;
Here you'd put an index on col1 and col2 together.