惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

A
About on SuperTechFans
Cloudbric
Cloudbric
C
CERT Recently Published Vulnerability Notes
G
GRAHAM CLULEY
V
Vulnerabilities – Threatpost
C
Cisco Blogs
T
Tenable Blog
P
Privacy International News Feed
T
The Exploit Database - CXSecurity.com
I
Intezer
AWS News Blog
AWS News Blog
IT之家
IT之家
博客园 - 司徒正美
C
Cybersecurity and Infrastructure Security Agency CISA
博客园 - 【当耐特】
The Hacker News
The Hacker News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Spread Privacy
Spread Privacy
S
SegmentFault 最新的问题
博客园 - Franky
人人都是产品经理
人人都是产品经理
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
V
Visual Studio Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
H
Hacker News: Front Page
Latest news
Latest news
Scott Helme
Scott Helme
腾讯CDC
宝玉的分享
宝玉的分享
大猫的无限游戏
大猫的无限游戏
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
A
Arctic Wolf
S
Securelist
雷峰网
雷峰网
The GitHub Blog
The GitHub Blog
Project Zero
Project Zero
Google DeepMind News
Google DeepMind News
P
Palo Alto Networks Blog
F
Fortinet All Blogs
Schneier on Security
Schneier on Security
云风的 BLOG
云风的 BLOG
Security Archives - TechRepublic
Security Archives - TechRepublic
The Last Watchdog
The Last Watchdog
WordPress大学
WordPress大学
MongoDB | Blog
MongoDB | Blog
L
LINUX DO - 最新话题
S
Schneier on Security
NISL@THU
NISL@THU
Jina AI
Jina AI
M
MIT News - Artificial intelligence

博客园 - Hicome

CentOS6 安装svn Nagios的配置文件 ZT 创建 PHP 测试页 ZT 命令行手工备份Ubuntu系统的方法 还原Ubuntu系统备份的方法 ZT SHELL编程实例+条件判断总结 ZT DELL服务器结合nagios硬件监控、报警 ZT CentOS下内存使用率查看 ZT swf文件格式解析入门(文件头解析)ZT 怎样压缩swf文件? ZT 使用NDOUtils将Nagios监控信息存入数据库 ZT 电脑自动重启的原因几处理方法 ZT DVD+R与DVD-R有什么区别 ZT CentOS 5.5安装apache2.2.17 ZT CentOS 卸载apache ZT Trac 下设置发邮件问题 Centos 下PHP的卸载与安装 ZT mysql的一些操作命令 Nginx负载均衡 ZT 【M8】使用的一些小技巧 电话,短信,联系人,音乐等功能
通过rpm包安装、配置及卸载mysql ZT
Hicome · 2011-03-10 · via 博客园 - Hicome

Posted on 2011-03-10 17:58  Hicome  阅读(243)  评论()    收藏  举报

通过rpm包安装、配置及卸载mysql的详细过程.

以MySQL-server-4.0.14-0.i386.rpm为例,放在/data目录下

cd /data

rpm -ivh MySQL-server-4.0.14-0.i386.rpm

安装完成后在/usr/share/mysql目录中会有一个mysql的启动脚本mysql.server及示例配置文件等(如my-huge.cnf、my-large.cnf、my-medium.cnf)

拷贝一个示例配置文件作为mysql的配置文件:

cp /usr/share/mysql/my-medium.cnf /etc/my.cnf

rpm包安装完后自动将mysql安装成系统服务,所以可以使用下面命令启动、停止mysql

启动mysql

/etc/init.d/mysql start 或 service mysql start

停止mysql

/etc/init.d/mysql stop 或 service mysql stop

到此,mysql服务就安装配置完成。

安装mysql客户端

rpm -ivh MySQL-client-4.0.14-0.i386.rpm

mysql安装好后目录结构如下:

工具程序在/usr/bin目录中---ls /usr/bin/mysql*

服务器程序/usr/sbin/mysqld

数据目录/var/lib/mysql

默认情况下mysql将错误日志文件、二进制日志文件及进程文件写在/var/lib/mysql目录中,如localhost.err、localhost.pid、localhost-bin.001等

要改变这些情况可以修改/etc/my.cnf文件

如将日志文件写在/var/log目录中,可以在my.cnf文件中加入下面两行:

[mysqld_safe]

err-log = /var/log/mysqld.log

有个实用程序/usr/bin/mysql_install_db,该程序可以用来初始化mysql数据库,即创建/var/log/mysql目录,及创建mysql数据库(mysql授权表等信息)及test数据库(空库),如果不小心删除了/var/log/mysql目录可以通过该程序来初始化.

卸载mysql

rpm -qa|grep -i mysql

rpm -ev MySQL-server-4.0.14-0 MySQL-client-4.0.14-0

卸载后/var/lib/mysql中的数据及/etc/my.cnf不会删除,如果确定没用后就手工删除

rm -f /etc/my.cnf

rm -rf /var/lib/mysql