`
java-mans
  • 浏览: 11431658 次
文章分类
社区版块
存档分类
最新评论

MySQL Cluster 共享权限

 
阅读更多

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

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics