Hadoop 集群搭建 (六):MySQL

MySQL:我就是个工具人…

kevin-ku-364843-unsplash

MySQL 安装配置

安装 mysql

仅在 Master

安装 mariadb: 开源版 MySQL

  • yum -y install mariadb-server mariadb
  • rpm -q mariadb mariadb-server

设置开机启动:

  • systemctl enable mariadb
  • systemctl daemon-reload

开启 mysql:

  • systemctl start mariadb

关闭 mysql:

  • systemctl stop mariadb

重启 mysql:

  • systemctl restart mariadb

查看 mysql 状态:

  • systemctl status mariadb

通过内置的安全脚本实现对数据库的安全保护

  • mysql_secure_installation

创建 Hive 账户

登录 root 账户:

  • mysql -uroot -p

创建账户:

  • CREATE USER 'alessa0'@'%' IDENTIFIED BY '{密码}';

设置 mysql 远程登录:

  • GRANT ALL ON . TO 'alessa0'@'%';

刷新权限:

  • flush privileges;