Centos6.5安装Mysql5.6.10

1. 先卸载掉老版本的mysql(linux严格区分大小写,查找的时候加上-i参数,和mysql相关的全部要卸)

[[email protected] ~]# rpm -qa | grep -i mysql
MySQL-devel-5.6.10-1.rhel5.x86_64
MySQL-server-5.6.10-1.rhel5.x86_64
MySQL-client-5.6.10-1.rhel5.x86_64

卸载(如果卸载不了,在命令后面加上--nodeps 强制卸载 eg: rpm -e mysql-libs-5.1.71-1.el6.x86_64 --nodeps)

2. 需要的安装文件

先下载下面三个文件

MySQL-devel-5.6.10-1.rhel5.x86_64
MySQL-server-5.6.10-1.rhel5.x86_64
MySQL-client-5.6.10-1.rhel5.x86_64

3. 安装

[[email protected] software]# rpm -ivh MySQL-devel-5.6.10-1.rhel5.x86_64.rpm
Preparing... ########################################### [100%]
1:MySQL-devel ########################################### [100%]

[[email protected] software]# rpm -ivh MySQL-client-5.6.10-1.rhel5.x86_64.rpm
Preparing... ########################################### [100%]
1:MySQL-client ########################################### [100%]

[[email protected] software]# rpm -ivh MySQL-server-5.6.10-1.rhel5.x86_64.rpm
Preparing... ########################################### [100%]
1:MySQL-server ########################################### [100%]

4. 启动

[[email protected] software] service mysql start

5. Mysql的默认密码

先查看.mysql_secret文件,最后面的串就是root的初始登陆密码(A1wCMNXo)
[[email protected] ~]# cat /root/.mysql_secret
# The random password set for the root user at Fri Jun 27 03:22:55 2014 (local time): A1wCMNXo

6. 登陆

[[email protected] ~]# mysql -uroot -p
Enter password: 这里输入上面的密码
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.6.10

Copyright (c) 2000, 2013, 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>
mysql> show databases;
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
mysql>

7. 提示修改密码才可以登陆

mysql> show databases;
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
修改密码
mysql> set password = password(‘123456‘);
Query OK, 0 rows affected (0.01 sec)
mysql> exit
Bye

8. 修改完成之后再登陆

[[email protected] ~]# mysql -uroot -p123456
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.6.10 MySQL Community Server (GPL)

Copyright (c) 2000, 2013, 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> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.01 sec)

mysql>

9. Navicat 8 for MySQL 连接(报错,这是因为需要远程登陆授权)

1103 - Host ‘192.168.6.46‘ is not allowed to connection to this MySQL server

mysql -u root -p123456
mysql>use mysql;
mysql>update user set host = ‘%‘ where user = ‘root‘;
mysql>flush privileges;
然后退出重启一下mysql就行了

10. 授权的时候报错

在执行update user set host = ‘%‘ where user = ‘root‘;报错
mysql> update user set host = ‘%‘ where user = ‘root‘;
ERROR 1062 (23000): Duplicate entry ‘%-root‘ for key ‘PRIMARY‘
那就直接执行下面的命令
mysql>flush privileges;
然后退出重启mysql就行了

11. 重启mysql

[[email protected] local]# service mysql restart
Shutting down MySQL....[ OK ]
Starting MySQL..[ OK ]

12. 安装完mysql发现

A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER !
You will find that password in ‘/root/.mysql_secret‘.

You must change that password on your first connect,
no other statement but ‘SET PASSWORD‘ will be accepted.
See the manual for the semantics of the ‘password expired‘ flag.

Also, the account for the anonymous user has been removed.

In addition, you can run:

/usr/bin/mysql_secure_installation

which will also give you the option of removing the test database.
This is strongly recommended for production servers.

See the manual for more instructions.

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available on the web at

http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

New default config file was created as /usr/my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings

MYSQL的默认配置文件在/usr/my.cnf并没有在/etc/my.cnf文件中

时间: 2024-10-14 03:53:03

Centos6.5安装Mysql5.6.10的相关文章

CentOS-6.3安装Mysql-5.5.29

安装方式分为rpm和源码编译安装两种,本文是采用mysql源码编译方式,编译器使用Cmake.软件需要mysql-5.5.29.tar.gz和cmake-2.8.10.2.tar.gz,请自行下载.下载地址:http://mysql.mirror.kangaroot.net/Downloads/http://www.cmake.org/files/v2.8/cmake-2.8.10.2.tar.gz其中mysql使用最新的稳定版本,即最新试用版的上一个版本,且非rc或者alpha的版本,Cmak

Centos6.5安装MySQL5.6备忘记录

Centos6.5安装MySQL5.6 1. 查看系统状态 [root@itzhouq32 tools]# cat /etc/issue CentOS release 6.5 (Final) Kernel \r on an \m [root@itzhouq32 tools]# uname -a Linux itzhouq32 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Lin

centos6.8安装mysql5.6【转】

首先先要去看看本机有没有默认的mysql, 本地默认有的,我们应先卸载,在安装新的这个逻辑. rpm -qa | grep mysql 我本机默认安装的mysql5.1.73 下一步删除 rpm -e --nodeps “要卸载的名字” rpm -e --nodeps mysql-libs-5.1.73-7.el6.x86_64 这样本机的mysql就算卸载完成,下面我们要安装新的 了. 有朋友问,为啥不用wge,用rz,其实用哪个都一样,自己习惯. 在usr/local下创建一mysql文件夹

CentOS6.5安装MySQL5.7

CentOS6.5安装MySQL5.7以hadoop用户登录系统,1.检测系统是否已经安装过mysql或其依赖,若已装过要先将其删除,否则第4步使用yum安装时会报错: #查看mysql是否安装,如果已经安装需要卸载,如果是 sudo rpm -qa|grep mysql 2.如果存在mysql,依次卸载 sudo yum -y remove mysql-community-server-5.7.23-1.el6.x86_64 sudo yum -y remove mysql-community

CentOS6.5安装MySQL5.1.73数据库

一.描述 本博客主要介绍CentOS6.5安装MySQL数据库 .启动和关闭MySQL服务.MySQL的登录和退出,以及My SQL数据库root用户的密码配置和修改. 二.主要步骤 1.查看本系统是否已经安装有MySQL数据库 先查看本操作系统是否已经安装有操作系统,显示只有一个mysql的类库,并没有安装该数据库. [[email protected] tongSoftware]$ rpm -qa | grep mysql mysql-libs-5.1.73-3.el6_5.x86_64 2

Windows安装Mysql5.7.10绿色版

今天在Windows上安装Mysql的时候,去官网上下了一个最新版本的Mysql5.7.10绿色版,但是之前网上安装方式都过时了,比如会报一些常见的错误“[ERROR] Fatal error: Can't open and lock privilegetables: Table 'mysql.user' doesn't exist”,毕竟是开源的东西,官方文档比较全,自己动手丰衣足食啊.下面是我参考官方文档的安装步骤. 1.解压下载的mysql安装包,复制mysql-default.ini,然

CENTOS6.5 安装 mysql5.6 以及搭建双主

一.Mysql5.6.10安装 1.1.必要软件 yum -y install gcc gcc-c++ autoconf automake bison ncurses-devel libtool-ltdl-devel* cmake make 1.2.编译安装 [[email protected] src]#groupadd mysql [[email protected] src]# useradd  mysql -g mysql [[email protected] src]# pwd /us

centos6.5 安装mysql-5.5

因为之前一直使用的是ubuntu很少使用centos,今天需要安装数据库,本着快速解决此需求的心态,开始安装mysql,但是翻看好多资料,最后还是没有成功,一个小时时间真是够够的了,最后虚心求教好友,终于看到Starting MySQL..... SUCCESS! 废话不多说,现在开始.也加深下自己的印象.总不能一直apt-get下去,centos不这样让你搞. 一:准备工作 配置防火墙,开启3306端口 [[email protected] ~]# vi /etc/sysconfig/ipta

Centos6.6安装MySQL5.6.24

1.首先需要编译器gcc 编译器和cmake yum -y install gcc+ gcc-c++ cd /usr/local/src wget http://www.cmake.org/files/v3.2/cmake-3.2.1.tar.gz 安装cmake 1 [[email protected] test]# tar -zxvf cmake-3.2.1.tar.gz 2 [[email protected] test]# cd cmake-3.2.1.tar.gz 3 [[email