Ask question

Ask Questions and Get Answers from Our Community

Answer

Answer Questions and Become an Expert on Your Topic

Contact Staff

Our Experts are Ready to Answer your Questions

Triển khai MySQL Cluster trên Windows Server - Part 4

thanhdc

Super Moderator
Joined
Aug 10, 2014
Messages
124
Reaction score
3
Points
18
Triển khai MySQL Cluster trên Windows Server - Part 4:

Đồng bộ users và privileges trên mỗi node:


Nếu bạn muốn đồng bộ users và privileges trên mỗi node thì bạn thực hiện các lệnh sql sau:
Code:
 [TABLE="class: grid, width: 840"]
[TR]
[TD][COLOR=#000000][FONT=Courier New]#Setup mysql privileges synchronous replication [/FONT][/COLOR]
[COLOR=#000000][FONT=Courier New]$ mysql -uroot -proot < C:\mcm\cluster\share\ndb_dist_priv.sql[/FONT][/COLOR]

[COLOR=#000000][FONT=Courier New]$ mysql -uroot -proot[/FONT][/COLOR]
[/TD]
[/TR]
[/TABLE]

[TABLE="class: grid, width: 840"]
[TR]
[TD][COLOR=#000000][FONT=Courier New]mysql> SELECT ROUTINE_NAME, ROUTINE_SCHEMA, ROUTINE_TYPE FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_NAME LIKE 'mysql_cluster%'  ORDER BY ROUTINE_TYPE;[/FONT][/COLOR]

[COLOR=#000000][FONT=Courier New]mysql> CALL mysql.mysql_cluster_move_privileges();[/FONT][/COLOR]

[COLOR=#000000][FONT=Courier New]mysql> SELECT CONCAT('Conversion ', IF(mysql.mysql_cluster_privileges_are_distributed(), 'succeeded', 'failed'), '.') AS Result;[/FONT][/COLOR]

[COLOR=#000000][FONT=Courier New]mysql> SELECT TABLE_NAME, ENGINE FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'mysql' AND TABLE_NAME LIKE '%backup' ORDER BY ENGINE;[/FONT][/COLOR]


[COLOR=#000000][FONT=Courier New]mysql> GRANT USAGE ON *.* to root@'%' IDENTIFIED BY 'root';[/FONT][/COLOR]

[COLOR=#000000][FONT=Courier New]mysql> FLUSH PRIVILEGES;[/FONT][/COLOR]
[/TD]
[/TR]
[/TABLE]












 
Last edited:
Top