linux 安装 mysql

本文介绍了如何在Linux系统上卸载旧版MySQL和MariaDB,然后安装MySQL 5.6版本,并启动服务。提供了具体的rpm命令来完成卸载、安装过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

#忽略大小写检查已安装的mysql
# rpm -qa|grep -i mysql
perl-DBD-MySQL-4.023-5.el7.x86_64
qt3-MySQL-3.3.8b-51.el7.x86_64
qt-mysql-4.8.5-8.el7.x86_64
akonadi-mysql-1.9.2-4.el7.x86_64
#卸载自带的MySQL
# rpm -e perl-DBD-MySQL-4.023-5.el7.x86_64 --nodeps
# rpm -e qt3-MySQL-3.3.8b-51.el7.x86_64 --nodeps
# rpm -e qt-mysql-4.8.5-8.el7.x86_64 --nodeps
# rpm -e akonadi-mysql-1.9.2-4.el7.x86_64 --nodeps
# rpm -qa|grep -i mariadb
mariadb-5.5.41-2.el7_0.x86_64
mariadb-devel-5.5.41-2.el7_0.x86_64
mariadb-server-5.5.41-2.el7_0.x86_64
mariadb-libs-5.5.41-2.el7_0.x86_64
#卸载mariadb
# rpm -e mariadb-5.5.41-2.el7_0.x86_64 --nodeps
# rpm -e mariadb-devel-5.5.41-2.el7_0.x86_64 --nodeps
# rpm -e mariadb-server-5.5.41-2.el7_0.x86_64 --nodeps
# rpm -e mariadb-libs-5.5.41-2.el7_0.x86_64 --nodeps
#安装
# rpm -ivh MySQL-server-5.6.26-1.linux_glibc2.5.x86_64.rpm
警告:MySQL-server-5.6.26-1.linux_glibc2.5.x86_64.rpm: 头V3 DSA/SHA1 Signature, 密钥 ID 5072e1f5: NOKEY
准备中... ################################# [100%]
正在升级/安装...
1:MySQL-server-5.6.26-1.linux_glibc################################# [100%]
======================================================================
A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER !
You will find that password in '/root/.mysql_secret'.

You must change that password on your first connect,
no other statement but 'SET PASSWORD' will be accepted.
See the manual for the semantics of the 'password expired' flag.

Also, the account for the anonymous user has been removed.

In addition, you can run:

/usr/bin/mysql_secure_installation

which will also give you the option of removing the test database.
This is strongly recommended for production servers.

See the manual for more instructions.

Please report any problems at http://bugs.mysql.com/

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

New default config file was created as /usr/my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings
======================================================================
# vi /root/.mysql_secret
# id mysql
uid=27(mysql) gid=27(mysql) 组=27(mysql)
# whereis mysql
mysql: /usr/bin/mysql /usr/lib64/mysql /usr/include/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz
# service mysql start
Starting MySQL. [ 确定 ]
# netstat -anp|grep 3306
tcp6 0 0 :::3306 :::* LISTEN 10202/mysqld
# rpm -ivh MySQL-client-5.6.26-1.linux_glibc2.5.x86_64.rpm
警告:MySQL-client-5.6.26-1.linux_glibc2.5.x86_64.rpm: 头V3 DSA/SHA1 Signature, 密钥 ID 5072e1f5: NOKEY
准备中... ################################# [100%]
正在升级/安装...
1:MySQL-client-5.6.26-1.linux_glibc################################# [100%]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值