Archive for April 2011

How to check if InnoDB engine is enabled in MySQL

If you want to  check ,  if InnoDB is enabled on  the server ,  you can  check  this via two methods :

1>

 [email protected][#] mysqladmin variables | grep  have_innodb

If the above command show the output as below :

| have_innodb                             | YES

then it means InnoDB is enabled.

2 > [email protected][#] mysql
mysql> show engines;
If the above command shows the below output : 

+————+———+—————————————————————-+
| Engine     | Support | Comment                                                        |
+————+———+—————————————————————-+
| MyISAM     | DEFAULT | Default engine as of MySQL 3.23 with great performance         |
| MEMORY     | YES     | Hash based, stored in memory, useful for temporary tables      |
| InnoDB     | YES     | Supports transactions, row-level locking, and foreign keys     |
| BerkeleyDB | NO      | Supports transactions and page-level locking                   |
| BLACKHOLE  | YES     | /dev/null storage engine (anything you write to it disappears) |
| EXAMPLE    | YES     | Example storage engine                                         |
| ARCHIVE    | YES     | Archive storage engine                                         |
| CSV        | YES     | CSV storage engine                                             |
| ndbcluster | NO      | Clustered, fault-tolerant, memory-based tables                 |
| FEDERATED  | YES     | Federated MySQL storage engine                                 |
| MRG_MYISAM | YES     | Collection of identical MyISAM tables                          |
| ISAM       | NO      | Obsolete storage engine                                        |
+————+———+—————————————————————-+

then it means InnoDB is enabled.

That’s all,  easy  isn’t it.

How to enable JSON support for PHP in CentOS/Plesk

If you  want to install / enable JSON support for PHP then  
follow the below steps :
  [email protected][#] yum update “*php*”
  [email protected][#] yum install php-pear
  [email protected][#] yum install gcc
  [email protected][#] pecl install json
  [email protected][#] cd /etc/php.d/
  [email protected][#] echo “extension=json.so” >> json.ini
  [email protected][#] /etc/init.d/httpd restart 

Or

If you want to manually install  JSON then  you can download and install 
it from  here : http://pecl.php.net/package/json


That’s all  you are done.