Thursday, May 26, 2011

MySql FEDERATED storage engine :Data to be accessed from a remote MySQL database on a local server without using replication or cluster technology

MySql FEDERATED storage engine :-

Than enable you to create table into local server Database and allow access data from Remote Server Database without using replication or cluster technology.

Use FEDERATED Tables :-

First, you must have a table on the remote server that you want to access by using a FEDERATED table. Suppose that the remote table is in the federated database and is defined like this:

CREATE TABLE test_table (
    id     INT(20) NOT NULL AUTO_INCREMENT,
    name   VARCHAR(32) NOT NULL DEFAULT '',
    other  INT(20) NOT NULL DEFAULT '0',
    PRIMARY KEY  (id),
    INDEX name (name),
    INDEX other_key (other)
)
ENGINE=MyISAM
DEFAULT CHARSET=latin1;
The example uses a MyISAM table, but the table       could use any storage engine.     
Next, create a FEDERATED table on the local server for accessing the remote table:

CREATE TABLE federated_table (
    id     INT(20) NOT NULL AUTO_INCREMENT,
    name   VARCHAR(32) NOT NULL DEFAULT '',
    other  INT(20) NOT NULL DEFAULT '0',
    PRIMARY KEY  (id),
    INDEX name (name),
    INDEX other_key (other)
)
ENGINE=FEDERATED
DEFAULT CHARSET=latin1
CONNECTION='mysql://fed_user@remote_host:9306/federated/test_table';
(Before MySQL 5.0.13, use COMMENT rather than       CONNECTION.)


Check FEDERATED Engine enable or not in database :-

mysql> show engines;
+------------+---------+
| Engine     | Support | 
+------------+---------+
| ndbcluster | NO      | 
| MRG_MYISAM | YES     | 
| BLACKHOLE  | YES     | 
| CSV        | YES     | 
| MEMORY     | YES     | 
| FEDERATED  | NO      | 
| ARCHIVE    | YES     | 
| InnoDB     | YES     | 
| MyISAM     | DEFAULT |
 
 
For Enable federated Engines into MYSQL :-
 
Add Below Line into my.ini or my.cnf :-
 
 [mysqld]
federated
 
Then Restart MySQL Server.




MySql Error Too many connections

The default setting for max_connections is 100. You can see what the current setting is by running the following SQL command from the MySQL command line tool, phpMyAdmin, or a similar tool:

show variables like "max_connections";
This will return a resultset like this, showing you what your current max connections setting is:

+-----------------+-------+
| Variable_name   | Value |
+-----------------+-------+
| max_connections | 100   |
+-----------------+-------+

To update the max_connections setting in MySQL :-


You can change the setting to e.g. 200 or more that depend upon ur server RAM size by issuing the following command without having to restart the MySQL server (obviously it will only work if the user you are logged in as has sufficient permissions to do this) ,no need to restart server:

set global max_connections = 200;
 
This will take effect immediately, but will be forgotten the next time MySQL is restarted. To make the change permanent you need to edit the my.cnf configuration file. On CentOS, RedHat and similar distributions this is at /etc/my.cnf; other distros will store it elsewhere.

Under the [mysqld] section add the following setting:

max_connections = 200
 
Now when you restart MySQL the next time it will use this setting instead of the default.

Note that increasing the number of connections that can be made will increase the potential amount of RAM required for MySQL to run. Increase the max_connections setting with caution!

Tuesday, May 10, 2011

Good Blog on tagg.in

Hi,
   I want to share some good blog on tagg.in ( Fast & free Sms blogging Site) .
   Where you can join by sending SMS Blog_Name to 92234 92234 (Normal Sms Cost / Free if you have free SMS Plan) or 560700 (cost Rs 2-3) or you can create your blog by sending SMS Create Your_Blog_Name to 92234 92234 or 560700 or you also login/Signup on http://www,tagg.in .Then you send & receive free Sms to your follower.


For Free IPL News send SMS Join Blog_name to 92234 92234 or 560700:-
  1)  FULL_SCORE
  2) ICCnet
  3) IPL_CRI
  4) ESPNSTARCRICKET
  5) SUNSPORTS

for Jokes :-
1) ONLYJOKE
2) Ruchi
3) HasiMazak

for News :-
1) HEADLINES
2) NEWSalerts
3) GP-NEWS
4) 100RBGoyal

for Health :-
1) ASTROINTL
and much more free Sms blog.