安装mysql
(注意:一定要root身份去执行)
rpm -qa | grep -i mysql查看系统自带的mysql
rpm -e –nodeps包名
在安装过新的版本:
# rpm -ivh /home/beifeng/MySQL-server-5.6.24-1.el6.x86_64.rpm
# rpm -ivh /home/beifeng/MySQL-client-5.6.24-1.el6.x86_64.rpm
# service mysql start
# cat /root/.mysql_secret 查询密码
mysql -uroot -p
修改密码
mysql> set password=password('abc123456789');
mysql> exit退出重新进入,已经需要新密码了
修改登录信息
mysql> use mysql;
mysql> update user set Host='%' where User='root' and Host='localhost';
删除其他用户信息(可以直接删除掉 更改用户 也就等于更换权限 也可以留着 直接给这用户赋予最大的权限)
mysql> delete from user where User='root' and Host='::1';
mysql> delete from user where User='root' and Host='127.0.0.1';
mysql> delete from user where User='root' and Host='sunlight133';
刷新修改生效
mysql> FLUSH PRIVILEGES;
赋予足够权限
mysql> grant all on *.* to hadoop@' SDTBDA119' identified by 'abc123456';
rpm -qa | grep -i mysql查看系统自带的mysql
rpm -e –nodeps包名
在安装过新的版本:
# rpm -ivh /home/beifeng/MySQL-server-5.6.24-1.el6.x86_64.rpm
# rpm -ivh /home/beifeng/MySQL-client-5.6.24-1.el6.x86_64.rpm
# service mysql start
# cat /root/.mysql_secret 查询密码
mysql -uroot -p
修改密码
mysql> set password=password('abc123456789');
mysql> exit退出重新进入,已经需要新密码了
修改登录信息
mysql> use mysql;
mysql> update user set Host='%' where User='root' and Host='localhost';
删除其他用户信息(可以直接删除掉 更改用户 也就等于更换权限 也可以留着 直接给这用户赋予最大的权限)
mysql> delete from user where User='root' and Host='::1';
mysql> delete from user where User='root' and Host='127.0.0.1';
mysql> delete from user where User='root' and Host='sunlight133';
刷新修改生效
mysql> FLUSH PRIVILEGES;
赋予足够权限
mysql> grant all on *.* to hadoop@' SDTBDA119' identified by 'abc123456';