MySQL Cluster Multi Computer Configuration
For our four-node, four-host MySQL Cluster, it is necessary to
write four configuration files, one per node host.
Each data node or SQL node requires a
my.cnf
file that provides two pieces of
information: a connectstring
that tells
the node where to find the management node, and a line telling
the MySQL server on this host (the machine hosting the data
node) to enable the NDBCLUSTER
storage engine.
For more information on connectstrings, see
Section 3.2.3, “The MySQL Cluster Connectstring”
.
The management node needs a config.ini
file telling it how many replicas to maintain, how much memory
to allocate for data and indexes on each data node, where to
find the data nodes, where to save data to disk on each data
node, and where to find any SQL nodes.
Configuring the Storage and SQL
Nodes
The my.cnf
file needed for the data nodes is
fairly simple. The configuration file should be located in the
/etc
directory and can be edited using any
text editor. (Create the file if it does not exist.) For example:
shell> vi /etc/my.cnf
Note
We show vi
being used here to create the
file, but any text editor should work just as well.
For each data node and SQL node in our example setup,
my.cnf
should look like this:
# Options for mysqld process:
[mysqld]
ndbcluster # run NDB storage engine
ndb-connectstring=192.168.0.10 # location of management server
# Options for ndbd process:
[mysql_cluster]
ndb-connectstring=192.168.0.10 # location of management server
After entering the preceding information, save this file and exit
the text editor. Do this for the machines hosting data node
“A
”,
相关文档:
#两日期/时间之间相差的天数:
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里的root权限的,
所以一般用户无法更改密码,除非请求管理员。
方法一
使用phpmyadmin,这是最简单的了,修改mysql库的user表,
不过别忘了使用PASSWORD函数。
方法二
使用mysqladmin,这是前面声明的一个特例。
mysqladmin -u root -p password mypas ......
mysqld程序--目录和文件
basedir = path 使用给定目录作为根目录(安装目录)。
character-sets-dir = path 给出存放着字符集的目录。
datadir = path 从给定目录读取数据库文件。
pid-file = filename 为mysqld程序指定一个存放进程ID的文件(仅适用于UNIX/Linux系统); Init-V脚本需要使用这个文件里的进程ID结束mysqld进 ......
需注意以下三点:
1、创建数据库的时候:CREATE DATABASE `database`
CHARACTER SET 'utf8'
  ......