安装mysql
卸载mysql
[bigdata@node101 ~]$ sudo rpm -qa | grep mariadb | xargs sudo rpm -e --nodeps
上传安装包到/opt/software目录并解压
[bigdata@node101 software]$ tar -xf mysql-5.7.28-1.el7.x86_64.rpm-bundle.tar -C mysql_lib/
到mysql_lib目录下顺序安装
[bigdata@node101 mysql_lib]$ sudo rpm -ivh mysql-community-common-5.7.28-1.el7.x86_64.rpm
[bigdata@node101 mysql_lib]$ sudo rpm -ivh mysql-community-libs-5.7.28-1.el7.x86_64.rpm
[bigdata@node101 mysql_lib]$ sudo rpm -ivh mysql-community-libs-compat-5.7.28-1.el7.x86_64.rpm
[bigdata@node101 mysql_lib]$ sudo rpm -ivh mysql-community-client-5.7.28-1.el7.x86_64.rpm
[bigdata@node101 mysql_lib]$ sudo rpm -ivh mysql-community-server-5.7.28-1.el7.x86_64.rpm
重启mysql
[bigdata@node101 ~]$ sudo systemctl restart mysqld
查看mysql状态
[bigdata@node101 ~]$ systemctl status mysqld
查看root密码
[bigdata@node101 ~]$ sudo cat /var/log/mysqld.log | grep password
重置密码
[bigdata@node101 ~]$ mysql -uroot -p'lzOkJwdks5+!'
mysql> set global validate_password_policy=0;
mysql> set global validate_password_length=6 ;
mysql> set password=password("123456");
mysql> use mysql
设置远程登录
mysql> update user set host="%" where user="root";
mysql> flush privileges;
修改字符集编码
[bigdata@node101 ~]$ sudo vim /etc/my.cnf
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
重启mysql
[bigdata@node101 ~]$ sudo systemctl restart mysqld
设置开机启动
[bigdata@node101 ~]$ sudo vim /etc/rc.d/rc.local
service mysqld start
本站资源均来自互联网,仅供研究学习,禁止违法使用和商用,产生法律纠纷本站概不负责!如果侵犯了您的权益请与我们联系!
转载请注明出处: 免费源码网-免费的源码资源网站 » 数据建设实践之大数据平台(四)安装mysql
发表评论 取消回复