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环境的基础组件& ... 
随机推荐
- Mac下使用Homebrew 安装MySQL
			安装 brew install mysql 卸载 brew uninstall mysql 启动mysql mysql.server start 管理员账户 mysql -uroot 
- Linux 的字符串截取很有用。有八种方法。
			假设有变量 var=http://www.aaa.com/123.htm 1. # 号截取,删除左边字符,保留右边字符. echo ${var#*//} 其中 var 是变量名,# 号是运算符,*// ... 
- 线性期望(BUPT2015校赛.F)
			将整体期望分成部分期望来做. F. network 时间限制 3000 ms 内存限制 65536 KB 题目描述 A social network is a social structure mad ... 
- 160823、ionic上拉/下拉更新数据
			<!DOCTYPE html> <html ng-app="myApp"> <head> <meta charset="UTF- ... 
- java集合的部分接口
			接口 Collection<E> public interface Collection<E>extends Iterable<E> Collection 层次结构 ... 
- mac开发环境爬坑记(搭建php+nginx+mysql+redis+laravel+git+phpstorm)
			题外话:前几天,终于以原价一半的价格,将我那台15版mbp在bbs上卖了出去.之所以用了“终于”这个词儿,是我一直迟迟没有下定决心卖掉它,可眼瞅着再不卖掉,又要掉价,况且我的新电脑,也终于下来了. 话 ... 
- Python3.6全栈开发实例[019]
			19.干掉主播.现有如下主播收益信息, 按照要求, 完成相应操作:(1)计算主播平均收益值 sum = 0 for i in zhubo.values(): sum +=i print(round(s ... 
- 【Java工程师之路】[1-2.2]Java10个面向对象设计原则
			面向对象设计原则是OOPS(Object-Oriented Programming System,面向对象的程序设计系统)编程的核心,但大多数Java程序员追逐像Singleton.Decorator ... 
- 修改mysql root的密码
			use mysql:update user set Password = Password('newPwd') where user='root';//更改root用户的密码flush privile ... 
- LeNet5
			Lecun Y, Bottou L, Bengio Y, et al. Gradient-based learning applied to document recognition[J]. Proc ... 
