1)chekc centos中是否安装了MySQL

[root@localhost MySQL]# rpm -qa | grep mariadb

mariadb-libs-5.5.52-1.el7.x86_64

2)卸载过程

[root@localhost MySQL]# rpm -e --nodeps mariadb-libs-5.5.52-1.el7.x86_64

3)安装过程

安装顺序如下:

rpm -ivh mysql-community-common-5.7.17-1.el7.x86_64.rpm

rpm -ivh mysql-community-libs-5.7.17-1.el7.x86_64.rpm

rpm -ivh mysql-community-client-5.7.17-1.el7.x86_64.rpm

rpm -ivh mysql-community-devel-5.7.17-1.el7.x86_64.rpm

rpm -ivh net-tools-2.0-0.17.20131004git.el7.x86_64.rpm

rpm -ivh mysql-community-server-5.7.17-1.el7.x86_64.rpm

4) 启动mysql

[root@localhost MySQL]# systemctl start mysqld

查看启动情况

[root@localhost MySQL]# ps -aux|grep -i mysql

mysql     2543  0.8 23.7 1119216 179968 ?      Sl   20:44   0:00 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid

root      2586  0.0  0.1 112648   976 pts/0    S+   20:45   0:00 grep --color=auto -i mysql

或者

[root@localhost MySQL]# netstat -na|grep -i 3306

tcp6       0      0 :::3306                 :::*                    LISTEN

unix  2      [ ACC ]     STREAM     LISTENING     13306    /var/run/dbus/system_bus_socket

5)使用root登陆MySQL

[root@localhost MySQL]# mysql -uroot -p

Enter password:

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

[root@localhost sbin]# whereis mysql

mysql: /usr/bin/mysql /usr/lib64/mysql /usr/include/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz

可以查看mysql的安装目录是/usr/bin

查看log

[root@localhost sbin]# cat  /var/log/mysqld.log

2017-01-10T12:43:28.664990Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

2017-01-10T12:43:32.450615Z 0 [Warning] InnoDB: New log files created, LSN=45790

2017-01-10T12:43:35.748969Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.

2017-01-10T12:43:36.574416Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 6779b126-d732-11e6-b856-0800275f50a5.

2017-01-10T12:43:36.677747Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.

2017-01-10T12:43:36.678899Z 1 [Note] A temporary password is generated for root@localhost: +x/GZM(Hf9=f

2017-01-10T12:44:38.169331Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

2017-01-10T12:44:38.172923Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.17) starting as process 2543 ...

2017-01-10T12:44:38.179188Z 0 [Note] InnoDB: PUNCH HOLE support available

2017-01-10T12:44:38.179226Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins

2017-01-10T12:44:38.179231Z 0 [Note] InnoDB: Uses event mutexes

2017-01-10T12:44:38.179235Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier

2017-01-10T12:44:38.179239Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3

2017-01-10T12:44:38.179245Z 0 [Note] InnoDB: Using Linux native AIO

2017-01-10T12:44:38.179462Z 0 [Note] InnoDB: Number of pools: 1

2017-01-10T12:44:38.179555Z 0 [Note] InnoDB: Using CPU crc32 instructions

2017-01-10T12:44:38.181302Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M

2017-01-10T12:44:38.188077Z 0 [Note] InnoDB: Completed initialization of buffer pool

2017-01-10T12:44:38.191550Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().

2017-01-10T12:44:38.203389Z 0 [Note] InnoDB: Highest supported file format is Barracuda.

2017-01-10T12:44:38.287616Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables

2017-01-10T12:44:38.287803Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...

2017-01-10T12:44:38.860560Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.

2017-01-10T12:44:38.865801Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.

2017-01-10T12:44:38.865872Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.

2017-01-10T12:44:38.867349Z 0 [Note] InnoDB: Waiting for purge to start

2017-01-10T12:44:38.920092Z 0 [Note] InnoDB: 5.7.17 started; log sequence number 2536132

2017-01-10T12:44:38.920917Z 0 [Note] Plugin 'FEDERATED' is disabled.

2017-01-10T12:44:38.932784Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool

2017-01-10T12:44:38.935813Z 0 [Note] InnoDB: Buffer pool(s) load completed at 170110 20:44:38

2017-01-10T12:44:39.061606Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.

2017-01-10T12:44:39.062541Z 0 [Warning] CA certificate ca.pem is self signed.

2017-01-10T12:44:39.109111Z 0 [Note] Server hostname (bind-address): '*'; port: 3306

2017-01-10T12:44:39.109573Z 0 [Note] IPv6 is available.

2017-01-10T12:44:39.109605Z 0 [Note]   - '::' resolves to '::';

2017-01-10T12:44:39.109643Z 0 [Note] Server socket created on IP: '::'.

2017-01-10T12:44:39.320841Z 0 [Note] Event Scheduler: Loaded 0 events

2017-01-10T12:44:39.321028Z 0 [Note] Executing 'SELECT * FROM INFORMATION_SCHEMA.TABLES;' to get a list of tables using the deprecated partition engine. You may use the startup option '--disable-partition-engine-check' to skip this check.

2017-01-10T12:44:39.321045Z 0 [Note] Beginning of list of non-natively partitioned tables

2017-01-10T12:44:39.349166Z 0 [Note] End of list of non-natively partitioned tables

2017-01-10T12:44:39.349489Z 0 [Note] /usr/sbin/mysqld: ready for connections.

Version: '5.7.17'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MySQL Community Server (GPL)

2017-01-10T12:47:14.947473Z 3 [Note] Access denied for user 'root'@'localhost' (using password: NO)

6) mysql设置

set global validate_password_policy=0

alter user 'root'@'localhost' identified by 'passw0rd';

create database hive;

create user 'hive' identified by 'passw0rd';

grant all privileges on hive.* to 'hive'@'%';

How to install MySQL on CentOS的更多相关文章

  1. How to Install MySQL on CentOS 7

    CentOS 7的yum源中貌似没有正常安装mysql时的mysql-sever文件,需要去官网上下载   # wget http://dev.mysql.com/get/mysql-communit ...

  2. Install MySql on CentOS

    Installing & Configuring MySQL Server This Howto will show you how to install MySQL 5.x, start t ...

  3. Install MySQL on CentOS 7

    原文:https://devops.profitbricks.com/tutorials/install-mysql-on-centos-7/ 1.下载mysql 在mysql官网选择适合的mysql ...

  4. yum install mysql on centos 6.5 zz

    http://www.cnblogs.com/xiaoluo501395377/archive/2013/04/07/3003278.html 1.使用yum命令进行mysql的安装 yum list ...

  5. Install Apache, PHP And MySQL On CentOS 7 (LAMP)

    This tutorial shows how you can install an Apache2 webserver on a CentOS 7.0 server with PHP5 suppor ...

  6. Install MySQL 5.7 on Fedora 25/24, CentOS/RHEL 7.3/6.8/5.11

    MySQL is a relational database management system (RDBMS) that runs as a server providing multi-user ...

  7. yum mysql on centos 7

    参考:https://www.linode.com/docs/databases/mysql/how-to-install-mysql-on-centos-7 centos 7上没有办法使用yum i ...

  8. Mysql之CentOS初探

    1. 卸载mysql 查看CentOS是否已经安装mysql数据库 rpm -qa | grep mysqlrpm -qa | grep MySQL 如果有,则卸载 // --nodeps表示强制rp ...

  9. How to install cacti on centos 6

    Cacti – Network and performance monitoring tool   Cacti is one of best monitoring tool used to monit ...

随机推荐

  1. 开涛spring3(9.1) - Spring的事务 之 9.1 数据库事务概述

    9.1  数据库事务概述 事务首先是一系列操作组成的工作单元,该工作单元内的操作是不可分割的,即要么所有操作都做,要么所有操作都不做,这就是事务. 事务必需满足ACID(原子性.一致性.隔离性和持久性 ...

  2. 二、 添加控制器Controller(ASP.NET MVC5 系列)

    MVC是Model-View-Controller的简写.MVC是一种开发良好架构,可测试,易维护应用程序的设计模式.据于MVC的应用程序应该包含: Models: 是呈现应用程序数据和使用验证逻辑给 ...

  3. 从插上网线到web页面请求,究竟发生了哪些过程?(计算机网络篇)

    一.说在前头 好久没有更新博客了,汗颜,最近忙于各种实验与报告,但是还是要抽时间总结一下学的东西.欢迎转载,但是要注明出处哦(=^ ^=). 最近学了计算机网络,正好总结一下.本篇博客的大部分是跟计算 ...

  4. JQuery中参数e,event

    与Flex类似,JavaScript中的事件也同样存在,捕获--触发--冒泡 三个节点.比较常见的情况是,在子DIV触发事件时,如果父DIV也监听同类事件,那么也会一起触发,并向上冒泡 jQuery对 ...

  5. unity3D:游戏分解之曲线

    一提到曲线,很多新手就头疼了,包括我.查了很多资料,终于有个大概的了解.想深入了解曲线原理的,推荐一个链接http://www.cnblogs.com/jay-dong/archive/2012/09 ...

  6. 使用java实现发送邮件的功能

    首先要在maven添加javamail支持 <dependency> <groupId>javax.activation</groupId> <artifac ...

  7. 基于angular的route实现单页面cnodejs

    Angular ui-router 前言 之前不太理解前端怎么实现路由功能,以前知道有一种方式使用html5的pushState可以操作url才实现路由的功能,在实践项目中也用过一次,后来这种操作叫成 ...

  8. Mac OS 的命令行 总结

    du 命令 查看目录下所有文件的大小: du -sh * ls 命令 直接显示当前目录下的所有的非隐藏文件: ls // 怎么在文章中显示不出来?? 显示当前目录下的所有的文件(包括隐藏的): ls ...

  9. javascript的setTimeout()与setTimeout()方法用法总结

    setTimeout与setInterval的区别: setTimeout 定义和用法: setTimeout()方法用于在指定的毫秒数后调用函数或计算表达式. 语法: setTimeout(code ...

  10. 用require.js封装原生js轮播图

    index.html页面: <!DOCTYPE html><html> <head> <meta charset="UTF-8"> ...