MySQL在linux上的rpm包方式安装方法

Posted ChavinKing

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MySQL在linux上的rpm包方式安装方法相关的知识,希望对你有一定的参考价值。

1、下载上传mysql server和client rpm包:

[root@faspdev mnt]# ls

MySQL-client-5.5.53-1.el6.x86_64.rpm

MySQL-server-5.5.53-1.el6.x86_64.rpm

2、安装mysql数据库:

1)安装mysql server端rpm包:

[root@faspdev mnt]# rpm -ivh MySQL-server-5.5.53-1.el6.x86_64.rpm

warning: MySQL-server-5.5.53-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Preparing...                ########################################### [100%]

   1:MySQL-server           ########################################### [100%]

2)安装mysql client端rpm包:

[root@faspdev mnt]# rpm -ivh MySQL-client-5.5.53-1.el6.x86_64.rpm

warning: MySQL-client-5.5.53-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Preparing...                ########################################### [100%]

   1:MySQL-client           ########################################### [100%]

3、启动、关闭mysql数据库:

1)命令方式:

*启动数据库:

[root@faspdev bin]# pwd

/usr/bin

[root@faspdev bin]# ./mysqld_safe &

[1] 21688

[root@faspdev bin]# 161018 17:47:08 mysqld_safe Logging to \'/var/lib/mysql/faspdev.err\'.

161018 17:47:08 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

*关闭数据库:

[root@faspdev bin]# pwd

/usr/bin

[root@faspdev bin]# ./mysqladmin -uroot shutdown

2)服务方式:

*启动数据库:

[root@faspdev ~]# service mysql status

MySQL is not running                                       [FAILED]

[root@faspdev ~]# service mysql start

Starting MySQL..                                           [  OK  ]

[root@faspdev ~]# service mysql status

MySQL running (21992)                                      [  OK  ]

*关闭数据库:

[root@faspdev ~]# service mysql stop

Shutting down MySQL.                                       [  OK  ]

[root@faspdev ~]# service mysql status

MySQL is not running                                       [FAILED]

4、访问数据库:

wpsB434.tmp

以上是关于MySQL在linux上的rpm包方式安装方法的主要内容,如果未能解决你的问题,请参考以下文章

MySQL安装

MySQL入门:Linux 6 RPM方式安装MySQL 8.0

MySQL入门:Linux 6 RPM方式安装MySQL 8.0

Linux 卸载MySQL

linux下 mysql完全卸载

转 Linux平台卸载MySQL总结