Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Safe Shutdown and Restart of MySQL Cluster


To shut down the cluster, enter the following command in a shell
on the machine hosting the management node:

shell> ndb_mgm -e shutdown
The -e
option here is used to pass a command to
the ndb_mgm
client from the shell. (See
Section 4.23, “Options Common to MySQL Cluster Programs”
, for more
information about this option.) The command causes the
ndb_mgm
, ndb_mgmd
, and any
ndbd
processes to terminate gracefully. Any SQL
nodes can be terminated using mysqladmin
shutdown
and other means.

To restart the cluster, run these commands:

On the management host (192.168.0.10
in our
example setup):

shell> ndb_mgmd -f /var/lib/mysql-cluster/config.ini
On each of the data node hosts
(192.168.0.30
and
192.168.0.40
):

shell> ndbd
On the SQL host (192.168.0.20
):

shell> mysqld_safe &
In a production setting, it is usually not desirable to shut down
the cluster completely. In many cases, even when making
configuration changes, or performing upgrades to the cluster
hardware or software (or both), which require shutting down
individual host machines, it is possible to do so without shutting
down the cluster as a whole by performing a rolling
restart
of the cluster. For more information about
doing this, see Section 2.6.1, “Performing a Rolling Restart of a MySQL Cluster”
.


Ïà¹ØÎĵµ£º

Mysql²éѯʱ£¬¶ÔÓÚÊýÖµÐÍ×ֶμӵ¥ÒýºÅ»áÒýÆðµÄÎó½â¡«

¼ÙÉèÓбí tb1
ID £ü name£ü
----+--------+
1   £ü2toon£ü
2   £ü1*xyz£ü
Óï¾ä1£º
 select * from  tb1 where ID='2toon' or name ='2toon';
mysql·þÎñÆ÷ÔÚijģʽÏ£¬¿ÉÒÔÖ´ÐÐÕâÌõ¾ä£¬¾Í³É¹¦·µ»ØÁ½Ìõ¼Ç¼£¬Ô­ÒòÔÚÓÚ ID=‘2toon’ ¼ÓÁ˵¥ÒýºÅ£¬mysql½âÊÍΪ ID=2.
Óï¾ä2
select * fro ......

MYSQL¼ÆËãÁ½ÈÕÆÚ/ʱ¼äÖ®¼äÏà²îµÄÌìÊý,ÃëÊý...·ÖÖÓ

#Á½ÈÕÆÚ/ʱ¼äÖ®¼äÏà²îµÄÌìÊý£º¡¡
To_Days(end_time)-To_Days(start_time)¡¡
  
#Á½ÈÕÆÚ/ʱ¼äÖ®¼äÏà²îµÄÃëÊý£º¡¡
SELECT¡¡UNIX_TIMESTAMP(end_time)-¡¡UNIX_TIMESTAMP(start_time);¡¡
  
#Á½ÈÕÆÚ/ʱ¼äÖ®¼äÏà²îµÄʱ·ÖÊý£º¡¡
  
SELECT¡¡SEC_TO_TIME(UNIX_TIMESTAMP(end_time)-¡¡UNIX_T ......

MySQL´æ´¢ÒýÇæ Ó¦ÓÃ


MySQL·þÎñÆ÷²ÉÓÃÁËÄ£¿é»¯·ç¸ñ£¬¸÷²¿·ÖÖ®¼ä±£³ÖÏà¶Ô¶ÀÁ¢£¬ÓÈÆäÌåÏÖÔÚ´æ´¢¼Ü¹¹ÉÏ¡£´æ´¢ÒýÇ渺Ôð
¹ÜÀíÊý¾Ý´æ´¢£¬ÒÔ¼°MySQLµÄË÷Òý¹ÜÀí¡£Í¨¹ý¶¨ÒåµÄAPI£¬MySQL·þÎñÆ÷Äܹ»Óë´æ´¢ÒýÇæ½øÐÐͨÐÅ¡£Ä¿Ç°Ê¹ÓÃ×î¶àµÄÊÇMyISAMºÍInnoDB¡£
InnoDB±»OracleÊÕ¹ººó£¬MySQL×ÔÐпª·¢µÄд洢ÒýÇæFalcon½«ÔÚMySQL6.0°æ±¾Òý½ø¡£
MyISAMÒýÇæÊÇÒ ......

VC++ Á¬½ÓMySQL Êý¾Ý¿â

°Ñmysql.h¸´ÖƵ½vcµÄĿ¼µÄincludeĿ¼ÏÂ
mysql.hÔÚÄãmysqlµÄ°²×°Ä¿Â¼ÏµÄincludeÀïÃæÈç:mysql\include
°Ñlibmysql.lib(ÔÚmysqlµÄ°²×°Ä¿Â¼Ï£¬ËÑË÷ϾÍÄÜÕÒµ½£©¸´ÖƵ½Õâ¸öĿ¼Ï£¨C:\Program Files\Microsoft Visual Studio 9.0\VC\lib£©£¬Òª²»Á¬½Ó»á³ö´í¡£
Èç¹û±àÒëÁ¬½Óʱ»¹Êdzö´í¡£¾Í°Ñlibmysql.lib¸´ÖƵ½ÄãÔ´³ÌÐòµÄÄ¿ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ