MySQL 安装

安装mysql前需要查询系统中含有的有关mysql的软件。

rpm -qa | grep -i mysql
 
如下 代表有mysql ,则先进行卸载
mysql-libs-5.1.73-3.el6_5.x86_64 

卸载命令  rpm -e --nodeps mysql-libs

下载mysql地址:http://dev.mysql.com/downloads/mysql/

tar  xvf MySQL-5.6.35-1.el6.x86_64.rpm-bundle.tar

yum install perl
rpm -ivh MySQL-server-5.6.35-1.el6.x86_64.rpm 
rpm -ivh MySQL-client-5.6.35-1.el6.x86_64.rpm
在安装启动mysql 服务
service  mysql start
查看自动生成的root用户 mysql 密码
cat /root/.mysql_secret 
# The random password set for the root user at Fri Dec 23 10:38:10 2016 (local time): OnprW0qIRTiFE5m0

运行/usr/bin/mysql_secure_installation,删除anonymous用户。

# /usr/bin/mysql_secure_installation  --user=mysql

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL

SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

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

password for the root user.  If you've just installed MySQL, 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): (输入自动生成的密码)

OK, successfully used password, moving on...

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

root user without the proper authorisation.

You already have a root password set, so you can safely answer 'n'.

Change the root password? [Y/n]  (是否更换root用户密码 y:是 n 否)

Change the root password? [Y/n] y

New password:

Re-enter new password:

Password updated successfully!

Reloading privilege tables..

... Success!

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? [Y/n] (是否删除匿名用户)

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] (是否禁止root用户远程登录)

Disallow root login remotely? [Y/n] y

... Success!

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? [Y/n] (是否删除test数据库)

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] (是否重新加载权限表)

Reload privilege tables now? [Y/n] y

... Success!

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

installation should now be secure.

Thanks for using MySQL!

Cleaning up...

[root@iZm5e7kgbuwjnnpwbned77Z ~]# chkconfig
abrt-ccpp                    0:off            1:off            2:off            3:off            4:off            5:off            6:off
mysql                        0:off            1:off            2:on             3:on             4:on             5:on             6:off
netconsole                   0:off            1:off            2:off            3:off            4:off            5:off            6:off
 安装完成后可以用mysql客户端进行远程连接了, root用户无法远程登录,
 需要在centos系统登录msyql 
mysql -u root –p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 5.6.35 MySQL Community Server (GPL)
 
Copyright (c) 2000, 2016, 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>
 
 
1.进行授权
#ip为192.168.29.1可以用root访问
GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.29.1' IDENTIFIED BY 'root' WITH GRANT OPTION;
 
#ip为172.5.0.97可以用root访问
GRANT ALL PRIVILEGES ON *.* TO 'root'@'172.5.0.97' IDENTIFIED BY 'root' WITH GRANT OPTION;
 
#任何主机都可以用root远程访问
GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "root";   
 
#刷新权限
flush privileges; 

2.修改表

update user set host = '%' where user = 'root';
flush privileges; 

centos 6.5 msyql5.6安装的更多相关文章

  1. 不要着急改代码,先想想--centos 6.8下编译安装tmux

    诸位读者新年好,2017开年第一篇博客,请允许我先问候一下看到这篇博客的诸位.写博客是我2017年定下的目标之一,希望我会坚持下去. 最近打算尝试一下tmux这个神器,于是有了这一篇关于思维方式的Bl ...

  2. CentOS 7.2.1511编译安装Nginx1.10.1+MySQL5.7.14+PHP7.0.11

    准备篇 一.防火墙配置 CentOS 7.x默认使用的是firewall作为防火墙,这里改为iptables防火墙. 1.关闭firewall: systemctl stop firewalld.se ...

  3. CentOS 7.2.1511编译安装Nginx1.10.1+MySQL5.6.33+PHP5.6.26

    准备篇 一.防火墙配置 CentOS 7.x默认使用的是firewall作为防火墙,这里改为iptables防火墙. 1.关闭firewall: systemctl stop firewalld.se ...

  4. CentOS 7下源码安装MySQL 5.6

    本文转载,并非原创. 目录 准备工作 运行环境 确认你的安装版本 下载MySQL 安装MySQL 准备安装环境 编译和安装 配置MySQL 单实例配置 单实例配置方法 添加防火墙 启动MySQL 重启 ...

  5. Centos 6.5 SNMP客户端安装及配置版本net-snmp-5.7.3

    Centos 6.5 SNMP客户端安装及配置SNMP版本:net-snmp-5.7.3.tar.gz1.下载软件cd /usr/local/srcyum -y install gccwget htt ...

  6. 决战大数据之二:CentOS 7 最新JDK 8安装

    决战大数据之二:CentOS 7 最新JDK 8安装 [TOC] 修改hostname # hostnamectl set-hostname node1 --static # reboot now 重 ...

  7. CentOS 7.0 Nvidia显卡安装步骤

    from: http://blog.sina.com.cn/s/blog_49c0985a0102v3fa.html CentOS 7.0 Nvidia显卡安装步骤: 1 在英伟达官网下载相应驱动 搜 ...

  8. Linux(CentOS、Ububtu)一键安装Openstack及其它参考文档汇总

    原文链接  http://www.aboutyun.com/thread-10920-1-1.html openstack相关资料 CentOS下一键安装Openstack  http://blog. ...

  9. CentOS 7下源码安装MySQL 5.7

    网上说linux安装mysql服务分两种安装方法: ①源码安装,优点是安装包比较小,只有几十M左右,缺点是安装依赖的库多,安装编译时间长,安装步骤复杂容易出错: ②使用官方编译好的二进制文件安装,优点 ...

随机推荐

  1. 修改目的端trail文件的最大大小--转载

    本文为原创,转载请注明出处: http://blog.csdn.net/msdnchina/article/details/38346435 修改目的端trail文件的最大大小. 本文产生的背景: 在 ...

  2. Android动态加载学习笔记(一)

    前言 上周五DPAndroid小分队就第二阶段分享内容进行了讨论,结果形成了三个主题:性能优化.动态加载.内核远离.我选择的是第二项——动态加载.在目前的Android开发中,这一部分知识还是比较流行 ...

  3. 自学python3随笔--连接数据库和写EXCEL文件实现

    近日在自学python3,选择python,是由于它命令比较简单,语法也不算复杂,对我来说,要实现的功能用100行语句就能够实现.另外,一个原因,它是脚本形式的,调试比较方便,对我这些有很长时间没有写 ...

  4. ldap实现用户认证

    LDAP的用户认证类. public class LDAPHelper { private DirectoryEntry _objDirectoryEntry; /// <summary> ...

  5. 二模15day1解题报告

    T1.合并序列(minval) 给出长为 n的AB两个序列求两两相加中最小的n个. 据说有证明(在蓝书上,优先队列部分)先把A[1~n]+b[1]入队,然后每取一个a[x]+b[y]就把a[x]+b[ ...

  6. Scorpio-CSharp总链接

    简介 源码目录介绍

  7. maven基本用法

    一.下载及安装 1.1 下载maven 3.1.1 先到官网http://maven.apache.org/download.cgi 下载最新版本(目前是3.1.1 ),下载完成后,解压到某个目录(本 ...

  8. 深入理解CSS溢出overflow & overflow:hidden真的失效了吗[转载]

    深入理解CSS溢出overflow http://www.cnblogs.com/xiaohuochai/p/5289653.html overflow:hidden真的失效了吗 http://www ...

  9. vi、vim 查找替换

    vi/vim 中可以使用 :s 命令来替换字符串.该命令有很多种不同细节使用方法,可以实现复杂的功能,记录几种在此,方便以后查询.    :s/vivian/sky/ 替换当前行第一个 vivian ...

  10. PAT 02-线性结构2 一元多项式的乘法与加法运算 (20分)

    设计函数分别求两个一元多项式的乘积与和. 输入格式: 输入分2行,每行分别先给出多项式非零项的个数,再以指数递降方式输入一个多项式非零项系数和指数(绝对值均为不超过1000的整数).数字间以空格分隔. ...