1、yum安装mysql:
[root@localhost Desktop]# cat /etc/yum.repos.d/rhel-local.repo
[rhel-source]
name=Red Hat Enterprise Linux $releasever - $basearch - Source
baseurl=file://"/media/RHEL_6.1 i386 Disc 1"/Server
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[root@localhost Desktop]# yum install mysql
Loaded plugins: product-id, refresh-packagekit, subscription-manager
Updating Red Hat repositories.
rhel-source | 4.0 kB 00:00 ...
rhel-source/primary_db | 2.4 MB 00:00 ...
Setting up Install Process
Resolving Dependencies
-->Running transaction check
--->Package mysql.i686 0:5.1.52-1.el6_0.1 will be installed
-->Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
mysql i686 5.1.52-1.el6_0.1 rhel-source 898 k
Transaction Summary
================================================================================
Install 1 Package(s)
Total download size: 898 k
Installed size: 2.3 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Installing : mysql-5.1.52-1.el6_0.1.i686 1/1
duration: 712(ms)
Installed products updated.
Installed:
mysql.i686 0:5.1.52-1.el6_0.1
Complete!
[root@localhost Desktop]#
1、首先连接 *** 作系统,切换到root用户。
如果是使用yum安装的mysql,使用如下命令进行卸载(不能确定使用何种方式安装的mysql情况下,按后续步骤一一进行处理即可):
# yum remove mysql mysql-server mysql-libs compat-mysql51
# rm -rf /var/lib/mysql
# rm /etc/my.cnf
使用rpm -qa|grep mysql命令来查看rpm方式安装的mysql,如果查询结果不为空,需要将这些rpm卸载掉。
2、如果是使用rpm方式安装的mysql,按如下步骤进行处理:
查看系统中是否以rpm包安装的mysql:
# rpm -qa | grep -i mysql
使用rpm -e 命令将上个命令中包列表一一进行卸载。
然后删除mysql相关的服务。
# chkconfig --list | grep -i mysql
# chkconfig --del mysql
3、然后找出OS中分散的mysql文件夹,并删除。
# find / -name mysql
StartingMySQL...................................[FAILED]
启动MYSQL都失败了当然没办法用了,解决方法如下
#chown
-R
mysql:mysql
/var/lib/mysql#/etc/init.d/mysqld
start启动
MySQL:
[
确定
][root@localhost
lib]#
mysqladmin
-uroot
password
'你需要设置的mysql密码'
[root@localhost
lib]#
mysql
-uroot
-p
Enter
password:
Welcome
to
the
MySQL
monitor.
Commands
end
with
or
\g.
Your
MySQL
connection
id
is
3
to
server
version:
4.1.11
Type
'help'
or
'\h'
for
help.
Type
'\c'
to
clear
the
buffer
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)