content_image/777776.jpg
+------------------------+--------------+------+-----+---------+-------+ 

The innodb_memcache.containers  table entry for the city table is defined as: 

mysql> INSERT INTO ‘innodb_memcache‘.‘containers‘ ( ‘name‘, ‘db_schema‘, ‘db_table‘, ‘key_columns‘, ‘value_columns‘, ‘flags‘, ‘cas_column‘, ‘expire_time_column‘, ‘unique_idx_name_on_key‘) VALUES (’default’, ’test’, ’city’, ’city_id’, ’name|state|country’, ’flags’,’cas’,’expiry’,’PRIMARY’); 

• default  is specified for the containers.name  column to configure the city  table as the default InnoDB  table to be used with the daemon_memcached  plugin. 

•Multiple InnoDB  table columns ( name , state , country ) are mapped to containers.value_columns  using a “|”  delimiter. 

•The flags , cas_column , and expire_time_column  fields of the innodb_memcache.containers  table are typically not significant in applications using the daemon_memcached  plugin. However, a designated InnoDB  table column is required for each. When inserting data, specify 0  for these columns if they are unused. 

3. After updating the innodb_memcache.containers  table, restart the daemon_memcache  plugin to apply the changes. 

mysql> UNINSTALL PLUGIN daemon_memcached; mysql> INSTALL PLUGIN daemon_memcached soname "libmemcached.so"; 

4. Using telnet, insert data into the city  table using a memcached set  command. 

telnet localhost 11211 Trying 127.0.0.1... Connected to localhost. Escape character is ’^]’. set B 0 0 22 BANGALORE|BANGALORE|IN STORED 

5. Using MySQL, query the test.city  table to verify that the data you inserted was stored. 

mysql> SELECT * FROM test.city; +---------+-----------+-----------+---------+-------+------+--------+ | city_id | name | state | country | flags | cas | expiry | +---------+-----------+-----------+---------+-------+------+--------+ | B | BANGALORE | BANGALORE | IN | 0 | 3 | 0 | +---------+-----------+-----------+---------+-------+------+--------+ 

6. Using MySQL, insert additional data into the test.city  table. 

mysql> INSERT INTO city VALUES (’C’,’CHENNAI’,’TAMIL NADU’,’IN’, 0, 0 ,0); mysql> INSERT INTO city VALUES (’D’,’DELHI’,’DELHI’,’IN’, 0, 0, 0); mysql> INSERT INTO city VALUES (’H’,’HYDERABAD’,’TELANGANA’,’IN’, 0, 0, 0); mysql> INSERT INTO city VALUES (’M’,’MUMBAI’,’MAHARASHTRA’,’IN’, 0, 0, 0); 

<img src='content_image/777776.jpg'>

## Note 

It is recommended that you specify a value of 0  for the flags , cas_column , and expire_time_column  fields if they are unused. 

7. Using telnet, issue a memcached get  command to retrieve data you inserted using MySQL. 

get H VALUE H 0 22 

