MySQL 多实例给root用户创建密码

DB:5.5.14

OS:CentOS 6.3


安装多实例MySQL数据库,安装完成后默认无密码,一次性给所有实例的root账户创建密码:


#!/bin/bash

for i  in {3361..3363}

do

/export/servers/mysql/bin/mysql -uroot  -S /export/data/mysql/tmp/mysql$i.sock    <<EOF

use mysql;

update user set password=password('123456') where user='root';

flush privileges;

EOF

done

posted @ 2016-01-29 17:17  __Yoon  阅读(247)  评论(0编辑  收藏  举报