首先CentOS7 已经不支持mysql,因为收费了你懂得,所以内部集成了mariadb,而安装mysql的话会和mariadb的文件冲突,所以需要先卸载掉mariadb,以下为卸载mariadb,安装mysql的步骤。

#列出所有被安装的rpm package

rpm -qa | grep mariadb

#卸载

rpm -e mariadb-libs-5.5.37-1.el7_0.x86_64

错误:依赖检测失败:

libmysqlclient.so.18()(64bit) 被 (已安裝) postfix-2:2.10.1-6.el7.x86_64 需要

libmysqlclient.so.18(libmysqlclient_18)(64bit) 被 (已安裝) postfix-2:2.10.1-6.el7.x86_64 需要

#强制卸载,因为没有--nodeps

rpm -e --nodeps mariadb-libs-5.5.37-1.el7_0.x86_64

#安装mysql依赖

yum install vim libaio net-tools

其他情况:

1、centos下yum暂时没有mysql-server直接安装包;

MariaDB是MySQL社区开发的分支,也是一个增强型的替代品;

2、安装MariaDB

yum -y install mariadb-server mariadb mariadb-devel

systemctl start mariadb

systemctl enable mariadb

mysql_secure_installation

firewall-cmd --permanent --add-service mysql

systemctl restart firewalld.service

iptables -L -n|grep 3306

In order to log into MariaDB to secure it, we'll need the current

password for the root user. If you've just installed MariaDB, and

you haven't set the root password yet, the password will be blank,

so you should just press enter here.

Enter current password for root (enter for none):

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

此处可以设置mysql的密码

Setting the root password ensures that nobody can log into the MariaDB

root user without the proper authorisation.

Set root password? [Y/n] Y

New password:

Re-enter new password:

Password updated successfully!

Reloading privilege tables..

... Success!

By default, a MariaDB installation has an anonymous user, allowing anyone

to log into MariaDB without having to have a user account created for

them. This is intended only for testing, and to make the installation

go a bit smoother. You should remove them before moving into a

production environment.

Remove anonymous users? [Y/n] Y

... Success!

Normally, root should only be allowed to connect from 'localhost'. This

ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] n

... skipping.

By default, MariaDB comes with a database named 'test' that anyone can

access. This is also intended only for testing, and should be removed

before moving into a production environment.

Remove test database and access to it? [Y/n] Y

- Dropping test database...

... Success!

- Removing privileges on test database...

... Success!

Reloading the privilege tables will ensure that all changes made so far

will take effect immediately.

Reload privilege tables now? [Y/n] Y

... Success!

Cleaning up...

All done! If you've completed all of the above steps, your MariaDB

installation should now be secure.

Thanks for using MariaDB!

跟着上面的设置,注意remote login这里设置为n.

1. 下载mysql的repo源

2. 安装mysql-community-release-el7-5.noarch.rpm包

$ sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm

安装这个包后,会获得两个mysql的yum repo源:/etc/yum.repos.d/mysql-community.repo,/etc/yum.repos.d/mysql-community-source.repo。

3. 安装mysql

$ sudo yum install mysql-server

根据步骤安装就可以了。

修改mysql的默认字符集

cat /etc/my.cnf

添加

character-set-server=utf8

default-character-set=utf8

好了,下一步

[root@nicknailo ~]# /usr/bin/mysql -u root -p

Enter password:

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 11

输入上面的设置密码

进入mysql客户端之后,show databases;

启动mysql服务:

1、使用 service 启动:service mysqld start

2、使用 mysqld 脚本启动:/etc/inint.d/mysqld start

持久化启动mysql  cd  /usr/bin/,

pm2 start mysql

[PM2] Starting /usr/bin/mysql in fork_mode (1 instance)

[PM2] Done.

┌──────────┬────┬──────┬───────┬────────┬─────────┬────────┬─────┬───────────┬──────┬──────────┐

│App name│id│mode│pid│status│restart│uptime│cpu│mem│user│watching│

├──────────┼────┼──────┼───────┼────────┼─────────┼────────┼─────┼───────────┼──────┼──────────┤

│app│1│fork│2330│online│0 │95m│0%│37.3 MB │root │disabled│

│app│3│fork│3498│online│0 │82m│0%│25.2 MB │root │disabled│

│mongo│0│fork│2104│online│0 │104m │0%│11.5 MB │root │disabled│

│mysql│5│fork│11449 │online│0 │0s │0%│2.0 MB│root │disabled│

└──────────┴────┴──────┴───────┴────────┴─────────┴────────┴─────┴───────────┴──────┴──────────┘

Use `pm2 show ` to get more details about an app

yum mysql 如何启动_CentOS7用yum安装MySQL与启动相关推荐

  1. dnf mysql数据库密码_CentOS7使用dnf安装mysql的方法

    本文介绍了CentOS7使用dnf安装mysql的方法,分享给大家,具体如下: 1.安装mysql的yum仓库 执行以下命令: 复制代码 代码如下: yum localinstall https:// ...

  2. 64位linux安装mysql数据库吗_CentOS7 64位安装mysql教程

    从最新版本的linux系统开始,默认的是 Mariadb而不是mysql!这里依旧以mysql为例进行展示 1.先检查系统是否装有mysql rpm -qa | grep mysql 1 1 这里返回 ...

  3. mysql 5.6 for centos_编译安装MySQL 5.6.16 for CentOS 6.4

    #--------------------------------------# # create by xk # by 2014-3-27 # 运维社区 #--------------------- ...

  4. 服务器centos安装mysql数据库_阿里云 centos7 安装mysql数据库

    环境:阿里云ECS服务器,系统为centos7.2 删除原来的数据库: centos7中默认安装了数据库MariaDB,如果直接安装MySQL的话,会直接覆盖掉这个数据库,当然也可以手动删除一下: [ ...

  5. mysql repo_centos7下使用wget命令安装mysql

    首先安装wget命令: 1. 下载mysql的repo源 $  wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm ...

  6. mysql数据库开启远程连接_安装MySQL数据库并开启远程访问

    一.安装MySQL数据库 MySQL安装在系统盘下(C:\Program Files),方便系统备份. 1.双击安装程序,勾选"I accept the license terms" ...

  7. yum方式安装mysql多实例_centos7下yum安装mysql5.6.30及单机配置多实例

    1.在mysql官网上载tar包 MySQL-5.6.30-1.el6.i686.rpm-bundle.tar 进目录cd /home/fuyouling/ 解压tar -xvf MySQL-5.6. ...

  8. CentOS7通过yum(使用清华源)方式安装MySQL 5.7

    下载并安装MySQL5.7的yum源 wget http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm yum loca ...

  9. centos mysql下载64位_CentOS7 64位安装mysql教程

    参考链接:http://baijiahao.baidu.com/s?id=1597184796823517712&wfr=spider&for=pc https://www.cnblo ...

最新文章

  1. 编程小问题系列(6)——新年第一帖: 关于Silverlight在VS2010RC下无法正常运行的问题...
  2. 详细介绍Oracle DBA工作职责
  3. pytorch笔记:搭建简易CNN
  4. c#扩展方法奇思妙用性能篇一:扩展方法性能初测
  5. mmsegmentation的demo测试-模型加载
  6. linux5 syscall 流程_Linux的上的程序是如何运行的,api机制是怎么样?
  7. K8S_Google工作笔记0010---通过二进制方式_生成SSL证书文件
  8. 【c++】字符串的冒泡排序【存疑,待查】
  9. 蓝桥杯省赛2017年Java组B组
  10. 头像+壁纸微信小程序源码
  11. python将npy文件转换成图片
  12. php 虚线怎么画,photoshop中设置虚线样式的方法总结
  13. TokenInsight 对话首席——智能法律合约,去中心化的法务、仲裁之路可否行通
  14. mangos新手教程 - 服务器配置文件中文说明
  15. mppdb 查看建表语句_内存MPP数据库介绍.pptx
  16. 《人物》:计算机世界第一人——艾兰·图灵(转贴)
  17. 给女生说一些关于软件测试职场的一些真实的建议~
  18. 4399移动产品经理:海量关键词优化策略
  19. 929. Unique Email Addresses*
  20. DataGrip初体验

热门文章

  1. juery 常用方法
  2. 网络(5)-应用层:了解常用协议使用的端口和底层协议
  3. Spring Boot系列教程六:日志输出配置log4j2
  4. 从文件夹内批量获取所有文件名 批处理脚本
  5. linux 画图 源码,Drawing:一款开源的类似微软画图的 Linux 桌面应用
  6. 说好的人工智能 怎么只看到高科技玩具?
  7. ldap认证服务的搭建
  8. 《Head.First设计模式读书笔记》之设计原则一、二和三
  9. Jquery 触发器之treigger()方法简介
  10. Cocos2d-x 3.x如何通过WebSocket连接服务器进行数据传输