怎么yum更新mysql mysql更新

如何使用MySQL yum源来安装更新MySQL相关软件包

MySQL yum库支持的平台有:

略阳ssl适用于网站、小程序/APP、API接口等需要进行数据传输应用场景,ssl证书未来市场广阔!成为成都创新互联的ssl证书销售渠道,可以享受市场价格4-6折优惠!如果有意向欢迎电话联系或者加微信:13518219792(备注:SSL证书合作)期待与您的合作!

Red Hat Enterprise Linux 7 / Oracle Linux 7

Red Hat Enterprise Linux 6 / Oracle Linux 6

Red Hat Enterprise Linux 5 / Oracle Linux 5

Fedora 18, 19, and 20

MySQL yum库包括最新的软件包有:

MySQL 5.6 (GA)

MySQL 5.7 (Development Release)

MySQL 5.5 (GA - Red Hat Enterprise Linux and Oracle Linux Only)

MySQL Workbench

MySQL Fabric

MySQL Utilities

MySQL Connector / ODBC

MySQL Connector / Python

RHEL7/CentOS7/Oracle linux7:

# rpm -Uvh dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

1

# rpm -Uvh dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

RHEL6/CentOS6/Oracle linux6:

# rpm -Uvh dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm

1

# rpm -Uvh dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm

RHEL5/CentOS5/Oracle linux5:

# rpm -Uvh dev.mysql.com/get/mysql-community-release-el5-5.noarch.rpm

1

# rpm -Uvh dev.mysql.com/get/mysql-community-release-el5-5.noarch.rpm

Fedora

# Fedora20

# rpm -Uvh dev.mysql.com/get/mysql-community-release-fc20-5.noarch.rpm

#Fedora19

# rpm -Uvh dev.mysql.com/get/mysql-community-release-fc19-5.noarch.rpm

# Fedora18

# rpm -Uvh dev.mysql.com/get/mysql-community-release-fc18-5.noarch.rpm

# Fedora20

# rpm -Uvh dev.mysql.com/get/mysql-community-release-fc20-5.noarch.rpm

#Fedora19

# rpm -Uvh dev.mysql.com/get/mysql-community-release-fc19-5.noarch.rpm

# Fedora18

# rpm -Uvh dev.mysql.com/get/mysql-community-release-fc18-5.noarch.rpm

如何从MySQL官方Yum仓库安装MySQL5.6

下载完成后将Yum库导入到你的本地:

sudo yum localinstallmysql-community-release-el6-*.noarch.rpm

这个Yum库包含了MySQLServer,MySQL工作台管理工具以及ODBC驱动,现在可以通过下面的命令简单地安装MySQLServer:

sudo yum install mysql-community-server

至此我就可以使用Yum简单地管理MySQL更新,并能确保总是从官网软件库得到最新的发布版。

附录:

1、root password update failed

ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement.

解决办法:

[**@localhost ~]# mysql

mysql set global read_only=0;

Query OK, 0 rows affected (0.00 sec)

mysql flush privileges;

Query OK, 0 rows affected (0.00 sec)

mysql quit

[**@localhost ~]# /usr/bin/mysql_secure_installation

如此便可以重新更新root密码了!

2、[ERROR] InnoDB: Cannot create log files because data files are corrupt or the database was not shut down cleanly after creating the data files.

解决办法:进入你的mysql数据存放目录,删除ibdata1文件即可,例如在我的环境下

#cd /var/lib/mysql

#mv ibdata1 ibdata1.bak

3、[ERROR] InnoDB: space header page consists of zero bytes in data file ./ibdata1

解决办法:修改配置文件my.cnf

根据个人环境空间大小和需求调节如下参数的值

innodb_buffer_pool_size = 256M

innodb_log_file_size = 256M

innodb_thread_concurrency = 16

innodb_flush_log_at_trx_commit = 2

添加一条:

innodb_flush_method=normal

4、ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

解决办法:Google上有很多,我遇到这个情况的时候只是使用/usr/bin/mysql_secure_installation 重新设置一次。

怎么样使用yum来安装mysql

1、安装

查看有没有安装过:

yum list installed mysql*

rpm -qa | grep mysql*

查看有没有安装包:

yum list mysql*

安装mysql客户端:

yum install mysql

安装mysql 服务器端:

yum install mysql-server

yum install mysql-devel

2、启动停止

数据库字符集设置

mysql配置文件/etc/my.cnf中加入default-character-set=utf8

启动mysql服务:

service mysqld start或者/etc/init.d/mysqld start

开机启动:

chkconfig -add mysqld,查看开机启动设置是否成功chkconfig --list | grep mysql*

mysqld 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭

停止:

service mysqld stop

3、登录

创建root管理员:

mysqladmin -u root password 123456

登录:

mysql -u root -p输入密码即可。

忘记密码:

service mysqld stop

mysqld_safe --user=root --skip-grant-tables

mysql -u root

use mysql

update user set password=password("new_pass") where user="root";

flush privileges;

4、远程访问

开放防火墙的端口号

mysql增加权限:mysql库中的user表新增一条记录host为“%”,user为“root”。

5、Linux MySQL的几个重要目录

数据库目录

/var/lib/mysql/

配置文件

/usr/share /mysql(mysql.server命令及配置文件)

相关命令

/usr/bin(mysqladmin mysqldump等命令)

启动脚本

/etc/rc.d/init.d/(启动脚本文件mysql的目录)

如若满意,请点击右侧【采纳答案】,如若还有问题,请点击【追问】

希望我的回答对您有所帮助,望采纳!


当前题目:怎么yum更新mysql mysql更新
本文路径:http://pwwzsj.com/article/dogcgeg.html