安装

#yum源
http://dev.mysql.com/downloads/repo/yum/
#安装
rpm -Uvh http://dev.mysql.com/get/mysql57-community-release-el6-7.noarch.rpm
yum install mysql-community-server
#启动服务
service mysqld start
#登录mysql
mysql -u root -p
# mysql5.7安装完成后会初始化一个root用户的默认密码
grep 'temporary password' /var/log/mysqld.log
2016-03-20T10:13:53.378957Z 1 [Note] A temporary password is generated for root@localhost: Ad2onLig55=l
#启动MySQL服务
service mysqld start
#执行MySQL的安全配置向导
[root@iZ11fek1j6cZ log]# mysql_secure_installation

Securing the MySQL server deployment.

Enter password for user root:
The 'validate_password' plugin is installed on the server.
The subsequent steps will run with the existing configuration
of the plugin.
Using existing password for root.

Estimated strength of the password: 100
Change the password for root ? ((Press y|Y for Yes, any other key for No) : n

... skipping.
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL 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? (Press y|Y for Yes, any other key for No) : 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? (Press y|Y for Yes, any other key for No) : n

... skipping.
By default, MySQL 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? (Press y|Y for Yes, any other key for No) : 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? (Press y|Y for Yes, any other key for No) : y
Success.

All done!

修改编码

vi /etc/my.cnf

[client]
default-character-set = utf8

[mysqld]
default-storage-engine = INNODB
character-set-server = utf8
collation-server = utf8_general_ci

#重启MySQL服务
service mysqld restart

#检查编码
$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor...
...
mysql> show variables like '%char%';
+--------------------------------------+----------------------------+
| Variable_name                        | Value                      |
+--------------------------------------+----------------------------+
| character_set_client                 | utf8                       |
| character_set_connection             | utf8                       |
| character_set_database               | utf8                       |
| character_set_filesystem             | binary                     |
| character_set_results                | utf8                       |
| character_set_server                 | utf8                       |
| character_set_system                 | utf8                       |
| character_sets_dir                   | /usr/share/mysql/charsets/ |
| validate_password_special_char_count | 1                          |
+--------------------------------------+----------------------------+
9 rows in set (0.00 sec)

mysql>

#开启自动启动服务
chkconfig mysqld on
#检查服务
chkconfig --list | grep mysql

卸载

#是否已经安装了mysql数据库
rpm -qa | grep mysql
#普通删除模式
rpm -e mysql
#强力删除模式
rpm -e --nodeps mysql
#是否已经卸载成功
rpm -qa | grep mysql

问题

ERROR 1130: Host 'xxx' is not allowed to connect to this MySQL server

解决方法:

1。 改表法。可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%"

use mysql;
mysql>update user set host = '%' where user = 'root';
mysql>select host, user from user;

REFER:
centos很正规的使用yum安装mysql5.7小白鼠版
http://www.hishenyi.com/archives/808
如果mysql中某sql执行慢,怎么记录下来
http://www.hishenyi.com/archives/763

CentOS 6.7 下 MYSQL 5.7 的安装与配置的更多相关文章

  1. Centos 7.3下 Linux For SQL Server安装及配置介绍

    Centos 7.3下 Linux For SQL Server安装及配置介绍 高文龙关注13人评论2828人阅读2017-03-05 21:46:21 Centos 7.3下Linux For SQ ...

  2. win10下MYSQL的下载、安装以及配置超详解教程(转)

    下载MYSQL 官网下载MYSQL5.7.21版本,链接地址https://www.mysql.com/downloads/.下载流程图如下: 进入官网点击Community,下载社区版. 找到MYS ...

  3. CentOS7下Mysql 5.6.30安装与配置

    环境:centos 7 x64 先下载mysql安装包 打开 http://dev.mysql.com/downloads/mysql/  选择 linux - Generic 再选择 下载完毕后,得 ...

  4. CentOS 6.7 下 PostgreSQL 9.5 的安装与配置

    #yum方式安装(不同的系统版本对应的版本也不同) yum install postgresql-server #安装指定版本 yum install https://download.postgre ...

  5. CentOS下MySQL 5.7编译安装

    CentOS下MySQL 5.7编译安装   文章目录 安装依赖包 下载相应源码包 添加mysql用户 预编译 编译安装 启动脚本,设置开机自启动 /etc/my.cnf,仅供参考 初始化数据库 设置 ...

  6. Linux系统环境下MySQL数据库源代码的安装

    Linux系统环境下MySQL数据库源代码的安装 基本环境:CentOS Linux release 7.8.2003 (Core).MySQL5.6 一.      安装环境准备 若要在Linux系 ...

  7. <亲测>CentOS 7.3下Node.js 8.6安装配置(含NPM以及PM2)

    CentOS 7.3下Node.js 8.6安装配置 2017年09月30日 14:12:02 阅读数:2245更多 个人分类: Nodejs   版权声明:本文为博主原创文章,未经博主允许不得转载. ...

  8. Windows 下 MySql 5.7.20安装及data和my.ini文件的配置(转)

    Windows 下 MySql 5.7.20安装及data和my.ini文件的配置     本文通过图文并茂的形式给大家介绍了MySql 5.7.20安装及data和my.ini文件的配置方法. my ...

  9. CentOS 下 Java 的下载、安装、配置

    CentOS 下 Java 的下载.安装.配置 系统: CentOS 7 x86_64 Java 版本: 1.8.0_171 本文将 Java 目录放在 /usr/local/java 文件夹下,读者 ...

随机推荐

  1. php常量 const 和 define

    常量是一个简单的标识符.在脚本执行期间该值不能改变(除了所谓的魔术常量,他们其实不是常量).常量默认大小写敏感.通常常量标识符总是大写的. 可以用define()函数来定义常量.在php5.3.0以后 ...

  2. javascript 经典问题汇总

    1. ["1","2","3"].map(parseInt) 为多少?答:[1,NaN,NaN]array.map(function(cur ...

  3. .net升级到4.0之后,出现;System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798

    今天在做从Silverlight页中跳转到aspx页的时候,出现错误: 第一次跳转的时候就出现这个错误,然后在点跳转或者刷新这个错误页面,问题就没有了. 解决方案: 在C:\Program Files ...

  4. Nodejs入门【转载】保留备用

    关于 本书致力于教会你如何用Node.js来开发应用,过程中会传授你所有所需的“高级”JavaScript知识.本书绝不是一本“Hello World”的教程. 状态 你正在阅读的已经是本书的最终版. ...

  5. day17(tomcat的安装,HTTP)

    Tomcat Tomcat是个小型服务器,由apache组织编写,转为发布java程序而写. 安装步骤: 官网:http://tomcat.apache.org/ 下载地址:http://tomcat ...

  6. 跟哥走,带你玩转Surface 2

    以为自己是数码控?觉得自己买了Surface就无所不能?别逗了!来看哥怎么玩平板,也让你们这些小虾米看看,什么才叫“玩转”! 新技能Get:密码不在用键盘 什么?每次开机你还要输入一长串密码?都什么年 ...

  7. python 读取hive数据

    话不多说,直接上代码 from pyhive import hivedef pyhive(hql): conn = hive.Connection(host='HiveServer2 host', p ...

  8. cpu、内存、raid初识

    计算机基础 1u = 4.45cm dmidecode -s system-product-name 查看linux系统是物理机还是虚拟机 `逻辑CPU个数: cat /proc/cpuinfo | ...

  9. SQL Server 2008 表分区的含义

    https://www.cnblogs.com/knowledgesea/p/3696912.html 继续看这个文档 http://www.360doc.com/content/16/0104/11 ...

  10. Android-Failed to open zip file

    当AndroidStudio加载工程的时候,出现以下错误❌: 解决前的工程目录: 1.将以上错误认真的分析: 2.找到工程的 gradle文件夹/wrapper文件夹/gradle-wrapper.p ...