转自:http://blog.csdn.net/ylqmf/article/details/7866517
MySQL Cluster API节点 中mysql.user 表为MyISAM引擎,所以每个API都要配置权限系统,MySQL已经为我们提供了共享权限脚本。这个脚本主要作用就是将mysql.user 表MyISAM引擎更换为NDBCLUSTER引擎。
以 linux - Centos 单机 源码 编译 安装 mysql cluster 7.2.7 source install 为例,执行下面的脚本可以实现共享权限。
tudou@b2c.xiaomi.com
- #share privilege
- /opt/soft/mysql-cluster-7.2.7/bin/mysql -S/tmp/mysql3350.sock </opt/soft/mysql-cluster-7.2.7/share/ndb_dist_priv.sql
- /opt/soft/mysql-cluster-7.2.7/bin/mysql -S/tmp/mysql3351.sock </opt/soft/mysql-cluster-7.2.7/share/ndb_dist_priv.sql
- /opt/soft/mysql-cluster-7.2.7/bin/mysql -S/tmp/mysql3352.sock </opt/soft/mysql-cluster-7.2.7/share/ndb_dist_priv.sql
- /opt/soft/mysql-cluster-7.2.7/bin/mysql -S/tmp/mysql3353.sock </opt/soft/mysql-cluster-7.2.7/share/ndb_dist_priv.sql
- #one of cluster API
- CALL mysql.mysql_cluster_move_privileges();
- FLUSH PRIVILEGES;
- #init root password
- /opt/soft/mysql-cluster-7.2.7/bin/mysqladmin -S/tmp/mysql3353.sock -u root password 123456
- #one of cluster API
- delete from user where LENGTH(password)<10;
- #create user
- GRANT ALL PRIVILEGES ON *.* TO 'tudou'@'192.168.%' IDENTIFIED BY '123456';
转自:http://blog.csdn.net/ylqmf/article/details/7866517
转载于:https://blog.51cto.com/imysqldba/1083614