MySQL Cluster Configuration — Basic Example
To support MySQL Cluster, you will need to update
my.cnf
as shown in the following example.
You may also specify these parameters on the command line when
invoking the executables.
Note
The options shown here should not be confused with those that
are used in config.ini
global
configuration files. Global configuration options are
discussed later in this section.
# my.cnf
# example additions to my.cnf for MySQL Cluster
# (valid in MySQL 5.1)
# enable ndbcluster storage engine, and provide connectstring for
# management server host (default port is 1186)
[mysqld]
ndbcluster
ndb-connectstring=ndb_mgmd.mysql.com
# provide connectstring for management server host (default port: 1186)
[ndbd]
connect-string=ndb_mgmd.mysql.com
# provide connectstring for management server host (default port: 1186)
[ndb_mgm]
connect-string=ndb_mgmd.mysql.com
# provide location of cluster configuration file
[ndb_mgmd]
config-file=/etc/config.ini
(For more information on connectstrings, see
Section 3.2.3, “The MySQL Cluster Connectstring”
.)
# my.cnf
# example additions to my.cnf for MySQL Cluster
# (will work on all versions)
# enable ndbcluster storage engine, and provide connectstring for management
# server host to the default port 1186
[mysqld]
ndbcluster
ndb-connectstring=ndb_mgmd.mysql.com:1186
Important
Once you have started a mysqld
process with
the NDBCLUSTER
and
ndb-connectstring
parameters in the
[mysqld]
in the my.cnf
file as shown previously, you cannot execute any
CREATE TABLE
or
ALTER TABLE
statements without
having actually started the cluster. Otherwise, these
statements will fail with an error. This is by
design
.
You may also use a separate [mysql_cluster]
相关文档:
要備份 MySQL 資料庫主要分為兩個方法,一是將資料庫目錄完整備份:二是使用 MySQL 內建的 mysqldump 程式。
備份資料庫目錄
MySQL 預設的儲存目錄在 /var/lib/mysql 內容,底下會 ......
sudo apt-get install mysql-server mysql-client
sudo apt-get install sun-java6-jdk(安装出意外,sudo dpkg -P sun-java6-bin,然后重新安装)
sudo vi /etc/network/interfaces 配置网络
auto eth0
iface eth0 inet dhcp(static)
address 192.168.8.108
netmask 255.255.255.0
gateway 192.168.8.1
:x保存
sud ......
<?php
$db_name="new";
mysql_connect("localhost","root","123456");
mysql_select_db($db_name);
$tb=mysql_list_tables($db_name);
$sql="";
while($query=mysql_fetch_row($tb)){
$sql="";$table_sql="";
$sql.= get_table_fn($query[0]);
get_table_row($que ......
CREATE DEFINER=`root`@`%` FUNCTION `sp_cn`(n_LowerMoney decimal(15,2)) RETURNS varchar(200) CHARSET utf8
begin
Declare v_LowerStr VARCHAR(200) ;
Declare v_UpperPart VARCHAR(200) ;
Declare v_UpperStr VARCHAR(200) ;
Declare i_I int ;
set v_LowerStr = LTRIM(RTRIM(ROUND(n_LowerMoney,2 ......
服务器业务类型对比 性能瓶颈
DB I/O磁盘
转发服务器 网卡PPS
动态WEB前台 CPU
静态WEB前台   ......