如何安装mysql
mysql下载地址,提取码:fxpu
链接:https://pan.baidu.com/s/1FFub0Y3SRtW6WwIDGQfUJQ
提取码:7bc6
navicat premium下载地址
安装步骤
本人在linux的root目录下新建tools文件夹,将mysql放入到tools文件夹中>
解压mysql,执行如下命令
tar -xvf mysql-5.7.19-1.el7.x86_64.rpm-bundle.tar
执行完后的tools文件夹如下:
在虚拟机上安装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
进入到mysql命令行,密码输入上一步查出的密码
mysql -u root -p
登陆后修改密码
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';
授权远程访问权限
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'Welcome_1' WITH GRANT OPTION; FLUSH PRIVILEGES;
链接mysql客户端,查看是否成功,我用的是navicat premium 。
至此mysql安装完成,下一篇讲如何linux下如何卸载mysql