redhat下安装mysql 5.6.20,解压zip包,查看已经安装过的mysql,卸载rpm安装包,安装mysqlserver端和client,改动mysqlusername,登陆mysql,启动关闭mysql
1 将相关的mysql rpm包上传到redhat上
2 我的电脑是Redhat 6.*版本号。所以这里使用上面一个
3 解压zip包
4 安装下面几个rpm
MySQL-client-advanced-5.6.20-1.el6.x86_64.rpm
MySQL-server-advanced-5.6.20-1.el6.x86_64.rpm
5
查看已经安装过的mysql
rpm –aq | grep mysql
结果:
mysql-libs-5.1.66-2.el6_3.x86_64
mod_auth_mysql-3.0.0-11.el6_0.1.x86_64
mysql-connector-java-5.1.17-6.el6.noarch
mysql-test-5.1.66-2.el6_3.x86_64
mysql-devel-5.1.66-2.el6_3.x86_64
libdbi-dbd-mysql-0.8.3-5.1.el6.x86_64
qt-mysql-4.6.2-25.el6.x86_64(这个不用卸载)
rsyslog-mysql-5.8.10-6.el6.x86_64
mysql-bench-5.1.66-2.el6_3.x86_64
mysql-connector-odbc-5.1.5r1144-7.el6.x86_64
dovecot-mysql-2.0.9-5.el6.x86_64
php-mysql-5.3.3-22.el6.x86_64
mysql-5.1.66-2.el6_3.x86_64
mysql-server-5.1.66-2.el6_3.x86_64
说明上面这些Mysql相关的已经安装了。
6
卸载上面安装过的mysql
使用rpm –e mysql –nodeps –allmatches (不理会依赖关系,删除全部上一步查出来的同样的mysql)命令卸载上面不须要的mysql
比如:
rpm -e mysql-libs-5.1.66-2.el6_3.x86_64--nodeps –allmatches
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdG90b3R1enVvcXVhbg==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="">
依照同样的命令对安装的其他mysql进行删除。
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdG90b3R1enVvcXVhbg==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="">
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdG90b3R1enVvcXVhbg==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="">
7
将老版本号的几个文件手工删除
[root@localhost mysql]# rm -f /etc/my.cnf
[root@localhost mysql]# rm -rf/var/lib/mysql
[root@localhost mysql]# rm -rf/var/share/mysql
[root@localhost mysql]# rm -rf/usr/bin/mysql*
[root@localhost mysql]#
8
安装mysqlserver端
[root@localhost mysql]# rpm -ivhMySQL-server-advanced-5.6.20-1.el6.x86_64.rpm
Preparing...
###########################################[100%]
1:MySQL-server-advanced ########################################### [100%]
2014-10-12 15:22:30 0 [Warning] TIMESTAMPwith implicit DEFAULT value is deprecated. Please use--explicit_defaults_for_timestamp server option (see documentation
for moredetails).
2014-10-12 15:22:30 6074 [Note] InnoDB:Using atomics to ref count buffer pool pages
2014-10-12 15:22:30 6074 [Note] InnoDB:Database physically writes the file full: wait...
2014-10-12 15:22:31 6074 [Note] InnoDB:Setting log file ./ib_logfile101 size to 48 MB
关于说明信息:
A RANDOM PASSWORD HAS BEEN SET FOR THEMySQL root USER !
You will find thatpassword in '/root/.mysql_secret'.
You must changethat password on your first connect,
no other statement but 'SET PASSWORD' willbe accepted.
See the manual for thesemantics of the 'password expired' flag.
Also, the account for theanonymous user has been removed.
In addition, you can run:
/usr/bin/mysql_secure_installation
which will also give you the option ofremoving the test database.
This is strongly recommended for productionservers.
See the manual for more instructions.
Please report any problems athttp://bugs.mysql.com/
The latest information about MySQL isavailable on the web at
http://www.mysql.com
Support MySQL by buying support/licenses athttp://shop.mysql.com
New default config file was created as/usr/my.cnf and
will be used by default by the server whenyou start it.
You may edit this file to change serversettings
9
安装mysql
的client
[root@localhost mysql]# rpm -ivhMySQL-client-advanced-5.6.20-1.el6.x86_64.rpm
Preparing... ########################################### [100%]
1:MySQL-client-advanced ########################################### [100%]
10
安装MySQL-devel-advanced-5.6.20-1.el6.x86_64.rpm
[root@localhost mysql]# rpm -ivhMySQL-devel-advanced-5.6.20-1.el6.x86_64.rpm
Preparing... ########################################### [100%]
1:MySQL-devel-advanced ########################################### [100%]
[root@localhost mysql]#
11
改动mysql的password。第一次安装的时候在,第一次安装的时候的password文件在/root/.mysql_secret中
改动password:
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdG90b3R1enVvcXVhbg==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="">
[root@localhost ~]# pwd
/root
12
查看password:cat.mysql_secret
oracle收购Mysql后,新版的mysql刚安装完mysql后不能直接输入mysql登录数据库,而是设置了默认free
passwordpassword,默认password放在了/root/.mysql_secret文件里,登陆后须要改动password.
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdG90b3R1enVvcXVhbg==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="">
13
改动password
A
启动mysql
service mysql start
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdG90b3R1enVvcXVhbg==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="">
B
假设想关闭服务。命令是servicemysql stop
14
登录server
mysql -u root -p
为用户设置新password
set password=password('123456');
也能够使用脚本 /usr/bin/mysql_secure_installation进行交互式的改动mysql的rootpassword
15.又一次启动一下redhat操作系统,然后再登陆(改动后再登陆发现登陆不了)
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdG90b3R1enVvcXVhbg==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="">
redhat下安装mysql 5.6.20,解压zip包,查看已经安装过的mysql,卸载rpm安装包,安装mysqlserver端和client,改动mysqlusername,登陆mysql,启动关闭mysql的更多相关文章
- java 解压 zip 包并删除
需求是这样的, 在服务器上有 运营上传的zip 包,内容是用户的照片,我需要做的是 获取这些照片上传,并保存到 数据库. 这里面的 上传照片,保存数据库都不难,主要问题是解压zip包,和删除zip ...
- win10下MySQL 5.7.20解压版安装步骤
1.从官网下载MySQL5.7.20解压版64位:https://dev.mysql.com/downloads/file/?id=473309. 2.解压(我的解压路径为:E:\mysql-5.7. ...
- 如何通过python代码解压zip包
转载至https://www.cnblogs.com/flyhigh1860/p/3884842.html 很多人在Google上不停的找合适自己的压缩,殊不知Py的压缩很不错.可以试试.当然C#,J ...
- mysql 5.7.20解压版安装配置
MySql 5.7.20版本免安装版配置过程 下载地址为: https://dev.mysql.com/downloads/mysql/ 最下面根据自己的操作系统选择合适的型号 下载完以后解压缩到 ...
- mysql5.7.12直接解压zip包,安装过程
MySQL-5.7.12-winx64.zip解压安装方式 1.解压文件到你想要安装的位置. 本人是直接解压到E盘. 2.配置环境变量,在path中放入:E:\mysql-5.7.12-win ...
- 在centos中使用rpm安装包安装jenkins
jenkins下载:http://pkg.jenkins-ci.org/redhat/ 下载rpm包到本地 在linux下使用rpm包安装命令: sudo rpm -ih jenkins-1.562- ...
- Ubuntu解压zip包中文乱码
解决方法:通过unar 工具解压 步骤一: 安装unar: sudo apt-get install unrar 步骤二: 解压(以test.zip为例):unar test.zip 解压成功,乱码问 ...
- python 操作Excel表格,解压zip包,压缩zip包,目录遍历
import zipfile import os,shutil import openpyxl file_list_pos="" fileName="" zip ...
- win10安装mysql5.7.20解压版
mysql安装包可到官网下载,地址:https://dev.mysql.com/downloads/mysql 1.首先解压文件包,我这解压到E:\install_work\mysql目录下: 2.发 ...
随机推荐
- 运用jquery做打印和导出操作
我最近接手的项目中经常让做出打印和导出统计图和表格 首先说打印,打印如果用echarts做出来的图表,打印的时候,要借助jquery的打印插件. 打印插件: <script src=" ...
- django常见问题小结,细节容易忽视
中文URL:这个其实是很常识的东西,但是之前做web一直没注意过,在使用HttpResponseRedirect的时候,如果Redirect的URL中带中文的话,会报UnicodeEncodeErro ...
- Java并发(十五):并发工具类——信号量Semaphore
先做总结: 1.Semaphore是什么? Semaphore(信号量)是用来控制同时访问特定资源的线程数量,它通过协调各个线程,以保证合理的使用公共资源. 把它比作是控制流量的红绿灯,比如XX马路要 ...
- [转载]for循环的执行顺序
原文地址:for循环的执行顺序作者:想飞上天的美人鱼 for循环的执行顺序用如下表达式: for(expression1;expression2;expression3) { expression ...
- 2015编程之美 初赛第一场C题 质数相关 二分图的最大匹配
质数相关 Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://hihocoder.com/contest/msbop2015round2a/prob ...
- JQ 使用模板
1.首先需要添加模板JS文件,
- 一些WPF中的滤镜特效——Effect Library
WPF支持类似PhotoShop的滤镜功能,称之为Effect.在.Net 4.0中,WPF就废弃了对BitMapEffect的支持,转向使用支持GPU加速的Effect类,例如,我们可以使用如下代码 ...
- unsigned int与int相加的问题-----C/C++小知识 区别
http://blog.csdn.net/thefutureisour/article/details/8147277 #include "stdafx.h" int _tmain ...
- VS2010下面Empty Project使用
VS2010下面Empty Project使用:1,添加代码HelloApp #include <afxwin.h> class CHelloApp:public CWinApp{publ ...
- 狗日的rem
rem这是个低调的css单位,近一两年开始崭露头角,有许多同学对rem的评价不一,有的在尝试使用,有的在使用过程中遇到坑就弃用了.但是我对rem综合评价是用来做web app它绝对是最合适的人选之一. ...