[iyunv@mysql11 ~]# ndb_mgmd -f/var/lib/mysql-cluster/config.ini
MySQL Cluster Management Server mysql-5.6.21ndb-7.3.7
2016-08-28 00:28:34 [MgmtSrvr] INFO -- The default config directory'/usr/mysql-cluster' does not exist. Trying to create it...
2016-08-28 00:28:34 [MgmtSrvr] INFO -- Sucessfully created config directory
2016-08-28 00:28:34 [MgmtSrvr] WARNING -- at line 7: [MGM] id is deprecated, useNodeId instead
2016-08-28 00:28:34 [MgmtSrvr] WARNING -- at line 16: [DB] id is deprecated, useNodeId instead
2016-08-28 00:28:34 [MgmtSrvr] WARNING -- at line 21: [DB] id is deprecated, use NodeIdinstead
2016-08-28 00:28:34 [MgmtSrvr] WARNING -- at line 26: [API] id is deprecated, useNodeId instead
2016-08-28 00:28:34 [MgmtSrvr] WARNING -- at line 30: [API] id is deprecated, useNodeId instead
2016-08-28 00:28:34 [MgmtSrvr] WARNING -- at line 30: Cluster configuration warning:
arbitrator with id 1 and db node with id 2 on same host 192.168.20.11
Running arbitrator on the same host as a database node may
cause complete cluster shutdown in case of host failure.
2016-08-28 00:28:34 [MgmtSrvr] WARNING -- at line 7: [MGM] id is deprecated, useNodeId instead
2016-08-28 00:28:34 [MgmtSrvr] WARNING -- at line 16: [DB] id is deprecated, useNodeId instead
2016-08-28 00:28:34 [MgmtSrvr] WARNING -- at line 21: [DB] id is deprecated, use NodeIdinstead
2016-08-28 00:28:34 [MgmtSrvr] WARNING -- at line 26: [API] id is deprecated, useNodeId instead
2016-08-28 00:28:34 [MgmtSrvr] WARNING -- at line 30: [API] id is deprecated, useNodeId instead
2016-08-28 00:28:34 [MgmtSrvr] WARNING -- at line 30: Cluster configuration warning:
arbitrator with id 1 and db node with id 2 on same host 192.168.20.11
Running arbitrator on the same host as a database node may
cause complete cluster shutdown in case of host failure.
[iyunv@mysql11 ~]#
[iyunv@mysql11 ~]# cat /root/.mysql_secret
# The random password set for the root userat Sat Aug 27 23:31:54 2016 (local time): oPjyozXIA05TSXb4
第一次登录
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[iyunv@mysql11 ~]# mysql -u root -poPjyozXIA05TSXb4
Warning: Using a password on the commandline interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version:5.6.21-ndb-7.3.7-cluster-gpl
Copyright (c) 2000, 2014, Oracle and/or itsaffiliates. All rights reserved.
Oracle is a registered trademark of OracleCorporation and/or its
affiliates. Other names may be trademarksof their respective
owners.
Type 'help;' or '\h' for help. Type '\c' toclear the current input statement.
mysql>
mysql> show databases; #第一使用数据库时,必须修改密码
ERROR 1820 (HY000): You must SET PASSWORDbefore executing this statement
mysql>
mysql> set password=password('111111');
Query OK, 0 rows affected (0.12 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| ndb_2_fs |
| ndbinfo |
| performance_schema |
| test |
+--------------------+
6 rows in set (0.10 sec)
mysql>
mysql> exit
Bye
来使用刚才修改的密码登录看
1
[iyunv@mysql11 ~]# mysql -uroot -p111111
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| ndb_2_fs |
| ndbinfo |
| performance_schema |
| test |
+--------------------+
6 rows in set (0.01 sec)
mysql12先查看默认密码
1
2
[iyunv@mysql12 ~]# cat /root/.mysql_secret
# The random password set for the root userat Sat Aug 27 23:53:13 2016 (local time): MjcJWscCjVpvnfDX
默认密码登录以后改密码
1
[iyunv@mysql12 ~]# mysql -uroot -pMjcJWscCjVpvnfDX
Warning: Using a password on the commandline interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.21-ndb-7.3.7-cluster-gpl
Copyright (c) 2000, 2014, Oracle and/or itsaffiliates. All rights reserved.
Oracle is a registered trademark of OracleCorporation and/or its
affiliates. Other names may be trademarksof their respective
owners.
Type 'help;' or '\h' for help. Type '\c' toclear the current input statement.
mysql> set password=password('111111');
Query OK, 0 rows affected (0.17 sec)
mysql> exit
Bye
使用修改的密码登录
1
[iyunv@mysql12 ~]# mysql -uroot -p111111
Warning: Using a password on the commandline interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version:5.6.21-ndb-7.3.7-cluster-gpl MySQL Cluster Community Server (GPL)
Copyright (c) 2000, 2014, Oracle and/or itsaffiliates. All rights reserved.
Oracle is a registered trademark of OracleCorporation and/or its
affiliates. Other names may be trademarksof their respective
owners.
Type 'help;' or '\h' for help. Type '\c' toclear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| ndb_3_fs |
| ndbinfo |
| performance_schema |
| test |
+--------------------+
6 rows in set (0.07 sec)