时间:2021-07-01 10:21:17 帮助过:33人阅读
// password 通过 cat ~/.mysql_secret 命令可以查看初始密码
[root@slave mytmp]# mysql -uroot -p
Enter password:
mysql> set password=password(‘mysql‘);
7、设置mysql开机启动
// 检查是否已经是开机启动
systemctl list-unit-files | grep mysqld
// 开机启动
systemctl enable mysqld.service
8、创建用户,分配权限,远程登陆授权
mysql -uroot -pmysql
GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘mysql‘ WITH GRANT OPTION;
FLUSH PRIVILEGES;
初始化hive库
mysql -u root -pmysql
CREATE USER ‘hive‘@‘%‘ IDENTIFIED BY ‘hive‘;
GRANT ALL PRIVILEGES ON *.* TO ‘hive‘@‘%‘;
CREATE USER ‘hive‘@‘localhost‘ IDENTIFIED BY ‘hive‘;
GRANT ALL PRIVILEGES ON *.* TO ‘hive‘@‘localhost‘;
CREATE USER ‘hive‘@‘host-name‘ IDENTIFIED BY ‘hive‘;
GRANT ALL PRIVILEGES ON *.* TO ‘hive‘@‘host-name‘;
FLUSH PRIVILEGES;
CREATE DATABASE `hive` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
centos7离线安装mysql
标签:目录 命令 ble 启动 mysql数据库 system l数据库 star systemctl