首页 / CENTOS / CentOS7安装MySQL
CentOS7安装MySQL
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了CentOS7安装MySQL,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2349字,纯文字阅读大概需要4分钟。
内容图文
![CentOS7安装MySQL](/upload/InfoBanner/zyjiaocheng/912/be34e038cb8946609bca2a2b0a5a71d1.jpg)
1.安装依赖
yum search libaio #检索是否有对应库 yum install -y libaio #安装依赖包
2.检查MySQL是否已经安装
yum installed | grep mysql No such command: installed. Please use /bin/yum --help
3.下载MySQL Yum Repository(yum仓库)
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
4.如果没有wget命令,则下载对应安装包
yum –y install wget
5.添加MySQL Yum Repository到系统repository列表中
yum localinstall mysql57-community-release-el7-10.noarch.rpm
6.验证是否添加成功
yum repolist enabled | grep "mysql.*-community.*"
?
7.安装MySQL
yum -y install mysql-community-server
8.启动MySQL
systemctl start mysqld systemctl status mysqld #查看状态
![CentOS7安装MySQL - 文章图片](/upload/getfiles/0001/2021/5/9/20210509071100093.jpg)
9.验证MySQL
登陆:mysql -uroot –p 输入密码登陆。 mysql: [Warning] Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.7.26 Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | +--------------------+ 4 rows in set (0.00 sec)
10.创建Hive需要的数据库
mysql> create database if not exists hive_metadata; Query OK, 1 row affected (0.01 sec) mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | hive_metadata | | mysql | | performance_schema | | sys | +--------------------+ 5 rows in set (0.00 sec)
为hive_metadata设置权限
grant all privileges on hive_metadata.* to 'hive'@'%' identified by 'hive'; grant all privileges on hive_metadata.* to 'hive'@'locaclhost' identified by 'hive'; grant all privileges on hive_metadata.* to 'hive'@'centos-master' identified by 'hive'; flush privileges;
(Navicat)连接测试
以上就是博主为大家介绍的这一板块的主要内容,这都是博主自己的学习过程,希望能给大家带来一定的指导作用,有用的还望大家点个支持,如果对你没用也望包涵,有错误烦请指出。如有期待可关注博主以第一时间获取更新哦,谢谢!同时也欢迎转载,但必须在博文明显位置标注原文地址,解释权归博主所有!
内容总结
以上是互联网集市为您收集整理的CentOS7安装MySQL全部内容,希望文章能够帮你解决CentOS7安装MySQL所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。