搭建mysql
下载mysql 的安装包道liunx上。
解压 tar -xvf mysql-5.7.19-1.el7.x86_64.rpm-bundle.tar
在上安装mysql:
卸载原先liunx上自带的mysql
yum remove mysql-libs
rpm -ivh mysql-community-common-5.7.19-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.19-1.el7.x86_64.rpm
客户端
rpm -ivh mysql-community-client-5.7.19-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-5.7.19-1.el7.x86_64.rpm
rpm -ivh mysql-community-devel-5.7.19-1.el7.x86_64.rpm (可选)
启动mysql:service mysqld start
或者:systemctl start mysqld.service
查看root用户的密码:cat /var/log/mysqld.log | grep password
登录后修改密码:alter user 'root'@'localhost' identified by 'welcome_1';
mysql数据库的配置:
创建一个新的数据库:create database hive;
创建一个新的用户:
create user 'hiveowner'@'%' identified by 'welcome_1';
给该用户授权
grant all on hive.* to 'hiveowner'@'%';
grant all on hive.* to 'hiveowner'@'localhost' identified by 'welcome_1'; 完毕。
如对本文有疑问, 点击进行留言回复!!
MySql添加新用户及为用户创建数据库和给用户分配权限方法介绍
Navicat出现无法远程连接MySql服务器问题的解决办法
网友评论