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”
.
相关文档:
假设有表 tb1
ID | name|
----+--------+
1 |2toon|
2 |1*xyz|
语句1:
select * from tb1 where ID='2toon' or name ='2toon';
mysql服务器在某模式下,可以执行这条句,就成功返回两条记录,原因在于 ID=‘2toon’ 加了单引号,mysql解释为 ID=2.
语句2
select * fro ......
这次是Fotolog
的经验,传说中比Flickr更大的网站
,Fotolog在21台服务
器上部署了51个memcached实例,总计有254G缓存空间
可用,缓存了多达175G的内容,这个数量比很多网站的数据库都要大的多,原文是A Bunch of Great Strategies for Using Memcached and MySQL Better Together
,我这里还是选择性的翻译以及按照 ......
里是一个使用日期函数的例子。下面的查询选择了所有记录,其date_col的值是在最后30天以内:
mysql> SELECT something from table
WHERE TO_DAYS(NOW()) - TO_DAYS(date_col) <= 30;
select TO_DAYS(NOW());
select now() ;
DAYOFWEEK( ......
Love in coding...
Free and Susan
[引]MySQL INNODB类型表的外键关联设置
Here is a simple example that relates parent and child tables through a single-column foreign key:
CREATE TABLE parent (id INT NOT NULL,
......
把mysql.h复制到vc的目录的include目录下
mysql.h在你mysql的安装目录下的include里面如:mysql\include
把libmysql.lib(在mysql的安装目录下,搜索下就能找到)复制到这个目录下(C:\Program Files\Microsoft Visual Studio 9.0\VC\lib),要不连接会出错。
如果编译连接时还是出错。就把libmysql.lib复制到你源程序的目 ......