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环境的基础组件& ...
随机推荐
- 使用Volley缓存图片时,缓存无效的原因。
使用Volley的ImageLoader异步获取并缓存图片时,发现有的网络图片已经缓存了,可是断网后却读不出来. ImageLoader的用法: RequestQueue requestQueue = ...
- @Resource 注解
@Resource 注解被用来激活一个命名资源(named resource)的依赖注入,在JavaEE应用程序中,该注解被典型地转换为绑定于JNDI context中的一个对象. Spring确实支 ...
- 【转】约瑟夫环算法---------题目:有n个人围成一圈,顺序排号,从第一个开始报数(从1到3报数),凡报到3的人退出圈子,问最后最后留下的是原来第几号的那位.
提示:用环形链表实现 对于这个题目其实就是用c语言的循环链表实现一个约瑟夫环.我们可以定义一个循环链表,将这n个人加入到链表中,然后定义三个节点指针在链表上循环,移动跨度为3,利用链表的循环功能每次删 ...
- Android无线测试之—Genymotion模拟器环境搭建
genymotion是一款号称速度最快性能最好的android模拟器,它基于Oracle VM VirtualBox.支持GPS.重力感应.光.温度等诸多传感器:支持OpenGL 3D加速:电池电量模 ...
- js原型对象中属性被覆盖(1)
/** *@author 程无衣 *@description 关于在原型对象中属性被覆盖 */ function Person(){} Person.prototy ...
- servlet;jsp;cookies;session
- 【BZOJ4176】Lucas的数论 莫比乌斯反演
[BZOJ4176]Lucas的数论 Description 去年的Lucas非常喜欢数论题,但是一年以后的Lucas却不那么喜欢了. 在整理以前的试题时,发现了这样一道题目“求Sigma(f(i)) ...
- error C1853: “Debug\BigBuffer.pch”预编译头文件来自编译器的早期版本,或者预编译头为 C++ 而在 C 中使用它(或相反)
<pre id="best-content-1299104064" mb-10"="" style="font-size: 14px; ...
- 网络免费API接口整理
转载自: https://www.cnblogs.com/doit8791/p/9351629.html 从网上看到一些免费API接口,在个人开发小程序等应用练手时可试用. 各类无次数限制的免费API ...
- centos安装lumen
刚开始安装报错,我用的是php7,先安装zip,uzip扩展 yum install zip unzip php7.0-zip 然后通过 Composer 的 create-project 命令来安装 ...