Centos6.5安装Mysql5.6.10
1. 先卸载掉老版本的mysql(linux严格区分大小写,查找的时候加上-i参数,和mysql相关的全部要卸)
[root@liuchao ~]# 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. 安装
[root@liuchao software]# rpm -ivh MySQL-devel-5.6.10-1.rhel5.x86_64.rpm
Preparing... ########################################### [100%]
1:MySQL-devel ########################################### [100%][root@liuchao software]# rpm -ivh MySQL-client-5.6.10-1.rhel5.x86_64.rpm
Preparing... ########################################### [100%]
1:MySQL-client ########################################### [100%][root@liuchao software]# rpm -ivh MySQL-server-5.6.10-1.rhel5.x86_64.rpm
Preparing... ########################################### [100%]
1:MySQL-server ########################################### [100%]
4. 启动
[root@liuchao software] service mysql start
5. Mysql的默认密码
先查看.mysql_secret文件,最后面的串就是root的初始登陆密码(A1wCMNXo)
[root@liuchao ~]# cat /root/.mysql_secret
# The random password set for the root user at Fri Jun 27 03:22:55 2014 (local time): A1wCMNXo
6. 登陆
[root@liuchao ~]# 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.10Copyright (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. 修改完成之后再登陆
[root@liuchao ~]# 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
[root@liuchao 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 settingsMYSQL的默认配置文件在/usr/my.cnf并没有在/etc/my.cnf文件中
Centos6.5安装Mysql5.6.10的更多相关文章
- centos6.5安装Mysql5.6及更改密码
(一) centos6.5安装Mysql5.6 二进制文件安装的方法分为两种: 第一种是不针对特定平台的通用安装方法,使用的二进制文件是后缀为.tar.gz的压缩文件: 第二种是使用RPM或其他包进行 ...
- Centos6.5安装MySQL5.6备忘记录
Centos6.5安装MySQL5.6 1. 查看系统状态 [root@itzhouq32 tools]# cat /etc/issue CentOS release 6.5 (Final) Kern ...
- 第三百九十九节,Django+Xadmin打造上线标准的在线教育平台—生产环境部署CentOS6.5安装mysql5.6
第三百九十九节,Django+Xadmin打造上线标准的在线教育平台—生产环境部署CentOS6.5安装mysql5.6 1.检测系统是否已经安装过mysql或其依赖,若已装过要先将其删除,否则第4步 ...
- 在Centos 5.4上安装Mysql5.5.10 (整理以前的工作文档)
1. 安装环境 1.1. 目的 安装Mysql5.5.10服务,提供公司XXXX测试环境.正式环境也采用该版本的mysql 1.2. 硬件环境 PC机:IntelE5300 内存4G 硬盘5 ...
- CentOS6.5安装MySQL5.6
CentOS6.5安装MySQL5.6,开放防火墙3306端口,允许其他主机使用root账户密码访问MySQL数据库 查看操作系统相关信息 ** 该查看方法只适用于CentOS6.5 (lsb_rel ...
- CentOS6.5安装mysql5.7
CentOS6.5安装mysql5.7 查看mysql的安装路径: [root@bogon ~]# whereis mysql mysql: /usr/bin/mysql /usr/lib/mysql ...
- centos6.8安装mysql5.6【转】
首先先要去看看本机有没有默认的mysql, 本地默认有的,我们应先卸载,在安装新的这个逻辑. rpm -qa | grep mysql 我本机默认安装的mysql5.1.73 下一步删除 rpm -e ...
- Centos6.4下安装mysql5.6.10
今天下午捣腾安装mysql和apache.从网上下载mysql5.6.10,http://ishare.iask.sina.com.cn/f/36050990.html,解压后发现没有configur ...
- CentOS安装MySQL-5.6.10+安全配置
注:以下所有操作均在CentOS 6.5 x86_64位系统下完成. #准备工作# 在安装MySQL之前,请确保已经使用yum安装了各类基础组件,具体见<CentOS安装LNMP环境的基础组件& ...
随机推荐
- HDOJ 4549 M斐波那契数列 费马小定理+矩阵高速幂
MF( i ) = a ^ fib( i-1 ) * b ^ fib ( i ) ( i>=3) mod 1000000007 是质数 , 依据费马小定理 a^phi( p ) = 1 ( ...
- PHPthinking邀请您一起赚Money
原文地址:http://bbs.phpthinking.com/thread-790-1-1.html 为了让大家工作或者学习之余.可以赚些money,PHPthinking为大家推荐一个赚钱的站点! ...
- Coursera课程《Machine Learning》学习笔记(week1)
这是Coursera上比较火的一门机器学习课程,主讲教师为Andrew Ng.在自己看神经网络的过程中也的确发现自己有基础不牢.一些基本概念没搞清楚的问题,因此想借这门课程来个查漏补缺.目前的计划是先 ...
- Qt for Android 启动短暂的黑屏或白屏问题如何解决?
解决方法一: 使用透明主题 点击项目 -> 在 构建设置 里面找到 Build Android APK 栏目,点击 create templates 创建一个 AndroidManifest.x ...
- python函数回顾:hex()
描述 hex() 函数用于将10进制整数转换成16进制,以字符串形式表示. 语法 hex 语法: hex(x) 参数说明: x -- 10进制整数 返回值 返回16进制数,以字符串形式表示. 实例 & ...
- 1、Python request(爬虫-百度翻译)
#encoding=utf-8 import requests def fanyi(): while True: context = input("请输入翻译的内容(退出q):") ...
- jquery on 确认删除
$(document).on('click', '.delbtn', function() { if (confirm("确定要删除吗?")) { ...
- Oracle学习笔记—Db_name、Db_domain、Global_name、Service_name、Instance_name和Oracle_SID(转载)
转载自: Oracle中DB_NAME,SID,DB_DOMAIN,SERVICE_NAME等之间的区别 Db_name:对一个数据库(Oracle database)的唯一标识.这种表示对于单个数据 ...
- Happy Hours, Happy Days
No matter our age, being happy creates more happiness--making a better world for all of us. 无论青春与否,让 ...
- 【python】获取列表中最长连续数字
最近开发遇到一个功能需求,目的是要获取一个AI分析结果中最长连续帧,比如一个视频中连续3帧有人,那么我认为这个视频就是有人,我就要判断这个视频帧列表中是否有连续的三帧有人.本质就是获取列表中的最长连续 ...