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'…
一天,我进入mysql后,查看所有用户 select host,user from mysql.user; 发现好多用户名, 太乱了,删除..... delete from user where user='root' and host='localhost'; 然后.....找回吧!! 1. 停止mysql服务(此步可略) systemctl stop mysql 2. 编辑mysql配置文件:my.cnf vim /etc/my.cnf # 添加: skip-grant-tables # w…