#yum安装mysql 5.7
yum remove mariadb* -y
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql57-community-release-el7-10.noarch.rpm
cd /etc/yum.repos.d/
sed -i 's/gpgcheck=1/gpgcheck=0/' mysql-community.repo
yum -y install mysql-community-server
systemctl start mysqld.service
systemctl enable mysqld.service
#在日志文件中找出root用户的初始密码
grep "password" /var/log/mysqld.log
#使用初始密码进入数据库之后修改密码
alter user 'root'@'localhost' identified by '新密码';
#给与权限
grant all privileges on *.* to root@"%" identified by "密码" with grant option;
flush privileges;
云端进行数据恢复
systemctl stop firewalld
#将/var/lib/mysql/下的数据备份到opt下的var_lib_mysql
cd /opt/
mkdir var_lib_mysql
cd /var/lib/mysql/
cp -a * /opt/var_lib_mysql
#在/usr/local下创建mysql目录,在mysql目录下创建data目录
cd /usr/local/
mkdir mysql
cd mysql/
mkdir data
mkdir data.bak
#将/var/lib/mysql/中的数据全部转移到data目录中并备份
cd /var/lib/mysql/
mv * /usr/local/mysql/data
cp -r /usr/local/mysql/data /usr/local/mysql/data.bak/
#修改配置文件
vim /etc/my.cnf
--修改成和本机一致--
一、运行一下算圆周率的测试代码,看下报错
cd /home/data_warehouse/module/hadoop-3.1.3/share/hadoop/mapreduce hadoop jar hadoop-mapreduce-examples-3.1.3.jar pi 1000 1000
后面2个数字参数的含义: 第1个1000指的是要运行1000次map任务 …