Archive for 'MYSQL'
How to optimize a table or database in mysql
If you are finding a lot of Long Running Queries and think you have built all the indexes you need. You might want to try to optimize the database files. As tables have inserts, the files can become less than optimized.
From the mysql manual…
shell> mysqlcheck [options] db_name [tables]
shell> mysqlcheck [options] –databases db_name1 [db_name2 db_name3…]
shell> mysqlcheck […]
Posted: July 8th, 2008 under MYSQL.
Comments: none
Logging long running queries in mysql
Here is another nugget from the mysql world.
Mysql has a built in logger for tracking down those queries that are long running queries. Technically mysql likes to call them “slow queries”
1. Login to your server as root
2. Open my.cnf with your favorite editor. Example:
[…]
Posted: March 29th, 2008 under Linux, MYSQL.
Comments: none
MySQL query_cache_size, how cache can help your website performance
here is a clipping from the MySQL manual regarding the query cache to help your website performance.
mysql> SHOW VARIABLES LIKE ‘query_cache_size’;
+——————+——-+
| Variable_name | Value |
+——————+——-+
| query_cache_size | 41984 |
+——————+——-+
For the query cache to actually be able to hold any query results, its size must be set larger:
mysql> SET GLOBAL query_cache_size = 1000000;
Query […]
Posted: February 5th, 2008 under Linux, MYSQL.
Comments: none
Upgrading PHP in cpanel from version 4 to 5
One thing to be aware of when doing the upgrade of cpanel via the WHM control panel, is that when you select your new version for the apache build, it unselects the check box for including PHP in the build. When the Build is complete running, you will have a PHP dead version of […]
Posted: June 16th, 2007 under PHP, Linux, MYSQL, WHM/cPanel, Apache.
Comments: none
Full Text Blind query expansion
essentially using the results of the first search to expand to find more revelant results
It works by performing the search twice, where the search phrase for the second search is the original search phrase concatenated with the few most highly relevant documents from the first search. Thus, if one of these documents contains the word […]
Posted: February 5th, 2007 under MYSQL.
Comments: none
Too many tables
If you have a database with thousands of tables, mysql can be a pain when changing to use the database. Try starting it up with the mysql -A option instead.
Posted: December 2nd, 2006 under Linux, MYSQL.
Comments: none