第一部分:安装Mysql5.7

1.下载YUM库

shell > wget http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
2.安装YUM库
shell > yum localinstall -y mysql57-community-release-el7-7.noarch.rpm
3.安装数据库
shell > yum install -y mysql-community-server

4.启动MySQL服务

shell > systemctl start mysqld.service

5.默认空密码

shell > mysql -uroot -p

6.重置root密码后重启mysql服务

shell > update mysql.user set authentication_string=password("yourpassword") where user="root" and Host="localhost";

shell > flush privileges;

shell > quit;

shell > systemctl restart mysqld;

如果手贱或者不知道啥原因出现如下问题:

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

请修改my.cnf,添加skip-grant-tables和skip-networking:

shell > vi /etc/my.cnf

[mysqld]

skip-grant-tables

skip-networking

重启mysql,然后重复以上修改密码步骤即可,记得修改完后,去掉my.cnf添加的两行。

第二部分:配置

1、添加远程登录用户(登入Mysql)
use mysql;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '你的密码' WITH GRANT OPTION;
注:'%'代表任意地址,也可以指定IP
2、检查用户表,刷新内存权限
select host, user from user;
FLUSH PRIVILEGES;
3、设置防火墙(CentOS7 不推荐)
vi /etc/sysconfig/iptables
在-A RH-Firewall-1-INPUT -j REJECT –reject-with icmp-host-prohibited之前,添加
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
重启防火墙
service iptables restart
注:centos7使用的是firewall防火墙
  systemctl stop firewalld.service #停止
  systemctl disable firewalld.service #禁用
4、设置字符编码集和区分大小写
4.1修改mysql配置文件(设置字符编码集)
默认位置:/etc/my.cnf
进入etc文件夹>>vim my.cnf
[mysqld]
character-set-server=utf8
collation-server=utf8_general_ci
* systemctl restart mysql.service #重启MySQL
* 查看当前mysql运行状态
 mysql>status
 
参数说明:
haracter_set_client:客户端请求数据的字符集。
character_set_connection:从客户端接收到数据,然后传输的字符集。
character_set_database:默认数据库的字符集,无论默认数据库如何改变,都是这个字符集;如果没有默认数据库,使character_set_server指定的字符集,此参数无需设置。
character_set_filesystem:把操作系统上文件名转化成此字符集,即把character_set_client转换character_set_filesystem,默认binary即可。
character_set_results:结果集的字符集。
character_set_server:数据库服务器的默认字符集。
character_set_system:这个值总是utf8,不需要设置,存储系统元数据的字符集。
4.2修改mysql配置文件(设置区分大小写)
lower_case_table_names 参数详解:
0:区分大小写
1:不区分大小写
下面看下修改后的预览图:
以上是经过自己实践后记录的,若有疑问欢迎各位留言讨论!

Linux Centos 7 使用yum安装 mysql5.7 (实验成功)的更多相关文章

  1. Linux CentOS 6.5 yum安装MongoDB的操作

    安装MongoDB的方法有很多种,可以源代码安装,在CentOS也可以用yum源安装的方法.由于MongoDB更新得比较快,我比较喜欢用yum源安装的方法.64位CentOS下的安装步骤如下: 1.准 ...

  2. linux centos中使用yum安装tomcat

    在linux下部署java开发的web应用,一般采用Tomact+jre环境(可不需要apache),在RHEL和CentOS下,可以采用yum在线自动安装方式安装,具体操作如下: 可以先查看tomc ...

  3. CentOS 6.*通过yum安装 MySQL-5.5

    转自https://www.cnblogs.com/wsl222000/p/5445768.html 1.安装mysql-5.5的yum源 rpm -ivh http://repo.mysql.com ...

  4. CentOS 6.5 yum安装mysql5.6或其他版本【默认yum只能安装mysql 5.1】 by jason

    by jason [备份配置文件] CentOS 6.5 默认yum只能安装mysql 5.1 安装前要检查机器原来是否安装过mysql,如有安装需要先进行数据备份.清理. [root@snails ...

  5. linux centos 7.3 编译安装mysql5.7

    #安装依赖 yum update yum install -y gcc gcc-c++ make libtool zlib zlib-devel openssl openssl-devel pcre ...

  6. [转]阿里云CentOS 7.1使用yum安装MySql5.6.24

    阿里云CentOS 7.1使用yum安装MySql5.6.24 作者:vfhky | 时间:2015-06-25 09:43 | 分类:web 在前面两篇文章<2015博客升级记(四):Cent ...

  7. Centos 升级MySQL版本或者Yum安装Mysql5.6

    Centos 升级MySQL版本或者Yum安装Mysql5.6 1.从MySQL Yum仓库下载最新的rpm文件:http://dev.mysql.com/downloads/repo/yum/Cen ...

  8. Linux yum安装MySQL5.7

    一.安装配置MySQL的yum源 # 安装MySQL的yum源,下面是RHEL6系列的下载地址 rpm -Uvh http://dev.mysql.com/get/mysql-community-re ...

  9. Linux yum安装MySQL5.7,及远程连接mysql(亲测有效!)

    一.安装配置MySQL的yum源 # 安装MySQL的yum源,下面是RHEL6系列的下载地址 rpm -Uvh http://dev.mysql.com/get/mysql-community-re ...

随机推荐

  1. thinkphp,ajax返回结果

    thinkphp 在Action中 利用dump输出的是<pre>success</pre> 利用echo输出的是 success 1.html eventResize: fu ...

  2. hdoj 5417 Victor and Machine

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5417 水题,一开始题目读错了做了好久,每次停工以后都是重新计时. 需要注意的是,先除后乘注意加括号 # ...

  3. spring+jpg环境下,spring实现文件上传

    jsp: <form method="post" action="excel.do?method=inputExcel" enctype="mu ...

  4. MVVM解决方案的一般结构

    解决方案的结构一般是三个解决方案文件夹,分别是: Models ViewModels Views 当然需要的话可以扩充,如Services.UnitTest等等. 然后每个解决方案文件夹里面包含各自的 ...

  5. erlang启动参数

    出自: http://blog.sina.com.cn/s/blog_96b8a154010123cc.html

  6. iOS开发-关于网络状态的判断

    在判断网络状态这个问题上,苹果提供了一个叫Reachability的第三方库,但是这个库并不能真正的检测我们的网络状态,我也是在调试程序的时候发现的.详情可以阅读这个博客http://blog.csd ...

  7. OAB配置

    OAB管理: http://blogs.technet.com/b/exchange_chs/archive/2013/01/31/exchange-server-2013-oab-managing- ...

  8. 【转】深入浅出REST

    转自:http://www.infoq.com/cn/articles/rest-introduction 不知你是否意识到,围绕着什么才是实现异构的应用到应用通信的“正确”方式,一场争论正进行的如火 ...

  9. Codeforces Round #136 (Div. 1)C. Little Elephant and Shifts multiset

    C. Little Elephant and Shifts Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/pro ...

  10. org.apache.catalina.mbeans.ServerLifecycleListener

    Tomcat 启动报错: java.lang.ClassNotFoundException: org.apache.catalina.mbeans.ServerLifecycleListener at ...