RHEL5.6环境下yum安装MySQL
RHEL5.6环境下yum安装MySQL记录,2017年2月20日
1、卸载原有的MySQL
rpm -qa命令查询是否安装了MySQL
[root@localhost mysql]# rpm -qa|grep mysql
mysql-server-5.0.77-4.el5_5.4
mysql-5.0.77-4.el5_5.4
使用rpm -e命令卸载安装包,如果卸载时提示依赖可以增加“--nodeps”参数;
如果想删除依赖项则直接卸载依赖项后再删除相应的包。
[root@localhost mysql]# rpm -e mysql-server-5.0.77-4.el5_5.4
[root@localhost mysql]# rpm -e mysql-5.0.77-4.el5_5.4
error: Failed dependencies:
libmysqlclient.so.15()(64bit) is needed by (installed) perl-DBD-MySQL-3.0007-2.el5.x86_64
libmysqlclient.so.15(libmysqlclient_15)(64bit) is needed by (installed) perl-DBD-MySQL-3.0007-2.el5.x86_64
[root@localhost mysql]# rpm -qa|grep MySQL
perl-DBD-MySQL-3.0007-2.el5
[root@localhost mysql]# rpm -e perl-DBD-MySQL-3.0007-2.el5
[root@localhost mysql]# rpm -e mysql-5.0.77-4.el5_5.4
2、yum安装MySQL
查询yum源中是否具有MySQL服务。
[root@localhost yum.repos.d]# yum list | grep mysql
This system is not registered with RHN.
RHN support will be disabled. apr-util-mysql.x86_64 1.2.7-11.el5_5.2 base
bytefx-data-mysql.x86_64 1.2.4-2.el5.centos extras
freeradius-mysql.x86_64 1.1.3-1.6.el5 base
freeradius2-mysql.x86_64 2.1.12-5.el5 base
libdbi-dbd-mysql.x86_64 0.8.1a-1.2.2 base
mod_auth_mysql.x86_64 1:3.0.0-3.2.el5_3 base
mysql.i386 5.0.95-5.el5_9 base
mysql.x86_64 5.0.95-5.el5_9 base
mysql-bench.x86_64 5.0.95-5.el5_9 base
mysql-connector-odbc.x86_64 3.51.26r1127-2.el5 base
mysql-connector-odbc64.x86_64 5.1.8-1.el5 base
mysql-devel.i386 5.0.95-5.el5_9 base
mysql-devel.x86_64 5.0.95-5.el5_9 base
mysql-server.x86_64 5.0.95-5.el5_9 base
mysql-test.x86_64 5.0.95-5.el5_9 base
mysql51.x86_64 1-9.el5 base
mysql51-build.x86_64 1-9.el5 base
mysql51-mysql.x86_64 5.1.70-1.el5 base
mysql51-mysql-bench.x86_64 5.1.70-1.el5 base
mysql51-mysql-libs.x86_64 5.1.70-1.el5 base
mysql51-mysql-server.x86_64 5.1.70-1.el5 base
mysql51-mysql-test.x86_64 5.1.70-1.el5 base
mysql51-runtime.x86_64 1-9.el5 base
mysql55.x86_64 1-12.el5 base
mysql55-build.x86_64 1-12.el5 base
mysql55-mysql.x86_64 5.5.45-1.el5 update
mysql55-mysql-bench.x86_64 5.5.45-1.el5 update
mysql55-mysql-devel.i386 5.5.45-1.el5 update
mysql55-mysql-devel.x86_64 5.5.45-1.el5 update
mysql55-mysql-libs.x86_64 5.5.45-1.el5 update
mysql55-mysql-server.x86_64 5.5.45-1.el5 update
mysql55-mysql-test.x86_64 5.5.45-1.el5 update
mysql55-runtime.x86_64 1-12.el5 base
pdns-backend-mysql.x86_64 2.9.21-4.el5.centos extras
php-mysql.x86_64 5.1.6-45.el5_11 update
php-pear-MDB2-Driver-mysql.noarch 1.4.1-3.el5.centos extras
php53-mysql.x86_64 5.3.3-26.el5_11 update
qt4-mysql.x86_64 4.2.1-1.el5_7.1 base
rsyslog-mysql.x86_64 3.22.1-7.el5 base
rsyslog5-mysql.x86_64 5.8.12-7.el5_11 update
[root@localhost yum.repos.d]#
安装MySQL及其相关服务
yum install -y mysql-server mysql mysql-devel
[root@localhost yum.repos.d]# rpm -qa|grep mysql
mysql-5.0.95-5.el5_9
mysql-devel-5.0.95-5.el5_9
mysql-devel-5.0.95-5.el5_9
mysql-5.0.95-5.el5_9
mysql-server-5.0.95-5.el5_9
可以看到mysql安装的包。
3、配置MySQL
3.1、查看MySQL服务状态
[root@localhost yum.repos.d]# service mysqld status
mysqld is stopped
3.2、启动MySQL服务
[root@localhost yum.repos.d]# service mysqld start
Initializing MySQL database: Installing MySQL system tables...
OK
Filling help tables...
OK To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h localhost.localdomain password 'new-password' Alternatively you can run:
/usr/bin/mysql_secure_installation which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers. See the manual for more instructions. You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe & You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl 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
[ OK ]
Starting mysqld: [ OK ]
[root@localhost yum.repos.d]#
查看MySQL服务状态:
[root@localhost yum.repos.d]# service mysqld status
mysqld (pid 5806) is running...
在终端中敲入mysql命令可以直接进入mysql命令行,此时MySQL没有设置登录密码。
[root@localhost yum.repos.d]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.0.95 Source distribution Copyright (c) 2000, 2011, 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>
3.3、启用MySQL登录密码:
[root@localhost yum.repos.d]# mysqladmin -u root password "passw0rd"
再次敲入mysql提示登录信息:
[root@localhost yum.repos.d]# mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
使用密码登录MySQL:
[root@localhost yum.repos.d]# mysql mysql -u root -p
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.0.95 Source distribution Copyright (c) 2000, 2011, 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>
3.4、允许root账号远程登录:
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'passw0rd' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)
RHEL5.6环境下yum安装MySQL的更多相关文章
- Linux下yum安装MySQL
写这篇文章的原因是:在刚开始使用Linux操作系统时想要搭建LAMP环境,于是开始在Google和百度上各种寻找资料,碰到了不是很多的问题后,我决定写这篇文章总结一下在Linux下yum安装MySQL ...
- linux系统下yum 安装mysql的方法
菜鸟一个,记录下yum 安装mysql的方法,给需要的朋友也做个参考吧. 弄了个新vps,想安装最新版的mysql,网上查了相关资料,记录如下: 1.安装查看有没有安装过: yum ...
- Linux下yum安装MySQL yum安装MySQL指定版本
yum安装MySQL 1. 查看有没有安装过 yum list installed MySQL* (有存在要卸载yum remove MySQL*) rpm -qa | grep my ...
- 【转】CentOS环境下yum安装LAMP(Linux+Apache+Mysql+php)
此种方法很简单.每次都用源码编译,浪费好多时间啊! 同样的网站程序在Linux下运行要比在windows下快出不少,所以决定使用Linux的发行版CentOS ,本文主要讲解在CentOS下使用yum ...
- linux下 yum 安装mysql和卸载
1.查看有没有安装过: yum list installed mysql* rpm -qa | grep mysql* 2.查看有没有安装包: yum list mysql* 3.安装mysql客户端 ...
- 阿里云,CentOS下yum安装mysql,jdk,tomcat
首先说明,服务器是阿里云的,centos6.3_64位安全加固版.首先需要登陆进来,使用的是putty,因为最初的时候,Xshell登陆会被拒绝. 0. 创建个人文件夹 # 使用 yum 安装tomc ...
- CentOS下yum安装mysql,jdk以及tomcat
首先说明,服务器是阿里云的,centos6.3_64位安全加固版.首先需要登陆进来,使用的是putty,因为最初的时候,Xshell登陆会被拒绝. 0. 创建个人文件夹 # 使用 yum 安装tomc ...
- Linux下yum安装MysqL数据库
1.命令安装mysql # yum install mysql mysql-server mysql-devel -y 最后提示 Complete! 表示安装成功 2.查看是否生成了mysqld服务 ...
- centos7环境下在线安装mysql
卸载mariadb centos默认安装了mariadb,因此,在安装mysql之前,需要卸载系统中安装的mariadb. 查看系统中所有已安装的mariadb包.命令:rpm -qa | grep ...
随机推荐
- 【HDOJ4812】D Tree(点分治)
题意: 给定一棵 n 个点的树,每个点有权值 Vi 问是否存在一条路径使得路径上所有点的权值乘积 mod(10^6 + 3) 为 K 输出路径的首尾标号,若有多解,输出字典序最小的解 对于100%的数 ...
- T1003 电话连线 codevs
http://codevs.cn/problem/1003/ 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 黄金 Gold 题目描述 Description 一个国家有n个城市 ...
- codevs——6221 数的统计
6221 数的统计 时间限制: 1 s 空间限制: 256000 KB 题目等级 : 白银 Silver 题解 题目描述 Description 有一个人名字叫A,B总喜欢打他. 这 ...
- 二级域名相同的情况下子页面调用父页面的js方法
这两天项目遇到这种需求.项目是一个平台级系统,其中嵌入了多款应用.在平台上可以使用这些应用操作业务. 现在产品提出了个需求:即在A应用中需要调用js方法来打开B应用. 处理方法是:平台js中给出个打开 ...
- CE310A
http://v.ku6.com/show/tvWNTLZTVWuGVPE5ZMSUyQ...html
- 赵雅智_Android的getResources()资源引用
今天做一个Android的刮刮乐项目.里面用到非常多的地方用到了getResources. <span style="font-size:12px;"> // 获得图片 ...
- Android进程间通信之内部类作为事件监听器
在Android中,使用内部类能够在当前类里面发用改监听器类,由于监听器类是外部类的内部类.所以能够自由訪问外部类的全部界面组件. 下面是一个调用系统内部类实现短信发送的一个样例: SMS类: pac ...
- form 表单序列化 serialize
在开发中有时需要在js中提交form表单数据,就需要将form表单进行序列化. jquery提供的serialize方法能够实现. $("#searchForm").seriali ...
- jQuery無刷新上傳之uploadify簡單試用
先簡單的侃兩句:貌似已經有兩個月的時間沒有寫過文章了,不過仍會像以前那样每天至少有一至兩個小時是泡在园子裏看各位大神的文章.前些天在研究“ajax無刷新上傳”方面的一些插件,用SWFUpload實現了 ...
- struts2学习笔记(8)-------struts2的ajax支持
struts2支持一种stream类型的Result,这样的类型的Result能够直接向client浏览器响应二进制,文本等. 我们能够再action里面生成文本响应,然后在client页面动态载入该 ...