- 1.先配置好yum网络源
– 1.1安装wget指令:
yum install wget
–1.2备份默认源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
–1.3下载新的CentOS-Base.repo到/etc/yum.repos.d/
weget xxxxx (具体对应的版本可以去http://mirrors.aliyun.com去下载)
– 1.4查看yum源
vi /etc/yum.repos.d/CentOS-Base.repo
– 1.5清除缓存并重建
yum clean all
yum makecache
- 2.卸载本机的mysql的rpm包
rpm -qa | grep mysql
rpm -e --nodeps 包名
…
- 3.自己去mysql官网下载相应版本的rpm包
用yum命令安装mysql
– 3.1 yum install mysql-common- xxxxxx
– 3.2 yum install mysql-lib- xxxxxxx
– 3.3 yum install mysql-cilent- xxxx
– 3.4 yum install mysql-server- xxxxxxxxx
-4. 启动mysql
centos6: service mysqld start
-5. 查找默认的root密码
cat /var/log/mysqld.log
-6 修改mysql密码
mysqladmin -u root -p password “新密码”
Enter password: 【输入原来的密码】
-7授权远程访问
进入mysql执行以下命令
grant all privileges on * . * to root @ ‘%’ identified by ‘root’ with grant option;
语句注释:
GRANT 【权限内容】 ON 【库名】.【表名】 TO 【用户名】@’【IP地址】’ IDENTIFIED BY ‘【密码】’ WITH GRANT OPTION;
-8.修改权限 方便hive的安装
进入mysql,切换到mysql数据库下,执行以下命令
delete from user where host !=’%’;
flush privileges;