MySQL 5.5.25(rpm)安装及升级到5.6.26 for RedHat Enterprise Linux 6.4.docx_第1页
MySQL 5.5.25(rpm)安装及升级到5.6.26 for RedHat Enterprise Linux 6.4.docx_第2页
MySQL 5.5.25(rpm)安装及升级到5.6.26 for RedHat Enterprise Linux 6.4.docx_第3页
MySQL 5.5.25(rpm)安装及升级到5.6.26 for RedHat Enterprise Linux 6.4.docx_第4页
MySQL 5.5.25(rpm)安装及升级到5.6.26 for RedHat Enterprise Linux 6.4.docx_第5页
已阅读5页,还剩5页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

MySQL 5.5.25(rpm)安装及升级到5.6.26 for RedHat Enterprise Linux 6.4环境:RedHat Enterprise Linux 6.4(64bit) MySQL:5.6.25 IP:66 步骤一:准备工作:a、建议删除系统存在的mysql用户rootmysql01 Desktop# id mysqluid=27(mysql) gid=27(mysql) groups=27(mysql)rootmysql01 Desktop# userdel -r mysqlb、清理已安装的mysql程序包rootsuzzy # rpm -qa|grep mysqlmysql-server-5.1.66-2.el6_3.x86_64dovecot-mysql-2.0.9-5.el6.x86_64qt-mysql-4.6.2-25.el6.x86_64rsyslog-mysql-5.8.10-6.el6.x86_64mysql-5.1.66-2.el6_3.x86_64mod_auth_mysql-3.0.0-11.el6_0.1.x86_64mysql-devel-5.1.66-2.el6_3.x86_64mysql-libs-5.1.66-2.el6_3.x86_64使用rpm -e 包名 (都地上面显示)来清除安装包,如果碰到不能报错不能删除,加上参数 -nodeps强制删除即可。例如:rootsuzzy # rpm -e qt-mysql-4.6.2-25.el6.x86_64error: Failed dependencies:qt4-mysql is needed by (installed) akonadi-1.2.1-2.el6.x86_64rootsuzzy # rpm -e qt-mysql-4.6.2-25.el6.x86_64 -nodepsrootsuzzy # rpm -e mysql-server-5.1.66-2.el6_3.x86_64 -nodepsrootsuzzy # rpm -e dovecot-mysql-2.0.9-5.el6.x86_64 -nodepsrootsuzzy # rpm -e qt-mysql-4.6.2-25.el6.x86_64 -nodepsrootsuzzy # rpm -e rsyslog-mysql-5.8.10-6.el6.x86_64 -nodepsrootsuzzy # rpm -e mysql-5.1.66-2.el6_3.x86_64 -nodepsrootsuzzy # rpm -e mod_auth_mysql-3.0.0-11.el6_0.1.x86_64 -nodepsrootsuzzy # rpm -e mysql-devel-5.1.66-2.el6_3.x86_64 -nodepsrootsuzzy # rpm -e mysql-libs-5.1.66-2.el6_3.x86_64 -nodeps 直到下面语句找不到mysql包为止rootmysql01 # rpm -qa | grep mysqlrootmysql01 # 注意:在卸载完成之后需要删除配置文件/etc/f和数据库文件/var/lib/mysql ,保守起见可将配置文件f进行改名处理。rootmysql01 Desktop# rpm -qpl MySQL-client-advanced-5.6.25-1.el6.x86_64.rpm rootmysql01 Desktop# rpm -qpl MySQL-devel-advanced-5.6.25-1.el6.x86_64.rpm rootmysql01 Desktop# rpm -qpl MySQL-embedded-advanced-5.6.25-1.el6.x86_64.rpm rootmysql01 Desktop# rpm -qpl MySQL-server-advanced-5.6.25-1.el6.x86_64.rpm rootmysql01 Desktop# rpm -qpl MySQL-shared-advanced-5.6.25-1.el6.x86_64.rpm rootmysql01 Desktop# rpm -qpl MySQL-shared-compat-advanced-5.6.25-1.el6.x86_64.rpm rootmysql01 Desktop# rpm -qpl MySQL-test-advanced-5.6.25-1.el6.x86_64.rpm 步骤二:开始安装1、建立用户组及用户rootmysql01 # groupadd mysqlrootmysql01 # useradd -g mysql mysql2、将下载好的mysql程序rpm包上传至服务器此处略过或者:rootmysql01 Desktop# unzip V76360-01.ziprootmysql01 Desktop# rpm -ivh MySQL-*Preparing. # 100% 1:MySQL-devel-advanced # 14% 2:MySQL-client-advanced # 29% 3:MySQL-test-advanced # 43% 4:MySQL-embedded-advanced# 57% 5:MySQL-shared-compat-adv# 71% 6:MySQL-shared-advanced # 86% 7:MySQL-server-advanced # 100%2015-08-28 10:56:58 0 Warning TIMESTAMP with implicit DEFAULT value is deprecated. Please use -explicit_defaults_for_timestamp server option (see documentation for more details).2015-08-28 10:56:58 0 Note /usr/sbin/mysqld (mysqld 5.6.25-enterprise-commercial-advanced) starting as process 4981 .2015-08-28 10:56:58 4981 Note InnoDB: Using atomics to ref count buffer pool pages2015-08-28 10:56:58 4981 Note InnoDB: The InnoDB memory heap is disabled2015-08-28 10:56:58 4981 Note InnoDB: Mutexes and rw_locks use GCC atomic builtins2015-08-28 10:56:58 4981 Note InnoDB: Memory barrier is not used2015-08-28 10:56:58 4981 Note InnoDB: Compressed tables use zlib 1.2.32015-08-28 10:56:58 4981 Note InnoDB: Using Linux native AIO2015-08-28 10:56:58 4981 Note InnoDB: Using CPU crc32 instructions2015-08-28 10:56:58 4981 Note InnoDB: Initializing buffer pool, size = 128.0M2015-08-28 10:56:58 4981 Note InnoDB: Completed initialization of buffer pool2015-08-28 10:56:58 4981 Note InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!2015-08-28 10:56:58 4981 Note InnoDB: Setting file ./ibdata1 size to 12 MB2015-08-28 10:56:58 4981 Note InnoDB: Database physically writes the file full: wait.2015-08-28 10:56:59 4981 Note InnoDB: Setting log file ./ib_logfile101 size to 48 MB2015-08-28 10:57:00 4981 Note InnoDB: Setting log file ./ib_logfile1 size to 48 MB2015-08-28 10:57:01 4981 Note InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile02015-08-28 10:57:01 4981 Warning InnoDB: New log files created, LSN=457812015-08-28 10:57:01 4981 Note InnoDB: Doublewrite buffer not found: creating new2015-08-28 10:57:01 4981 Note InnoDB: Doublewrite buffer created2015-08-28 10:57:01 4981 Note InnoDB: 128 rollback segment(s) are active.2015-08-28 10:57:01 4981 Warning InnoDB: Creating foreign key constraint system tables.2015-08-28 10:57:02 4981 Note InnoDB: Foreign key constraint system tables created2015-08-28 10:57:02 4981 Note InnoDB: Creating tablespace and datafile system tables.2015-08-28 10:57:02 4981 Note InnoDB: Tablespace and datafile system tables created.2015-08-28 10:57:02 4981 Note InnoDB: Waiting for purge to start2015-08-28 10:57:02 4981 Note InnoDB: 5.6.25 started; log sequence number 02015-08-28 10:57:02 4981 Note RSA private key file not found: /var/lib/mysql/private_key.pem. Some authentication plugins will not work.2015-08-28 10:57:02 4981 Note RSA public key file not found: /var/lib/mysql/public_key.pem. Some authentication plugins will not work.A random root password has been set. You will find it in /root/.mysql_secret.2015-08-28 10:57:03 4981 Note Binlog end2015-08-28 10:57:03 4981 Note InnoDB: FTS optimize thread exiting.2015-08-28 10:57:03 4981 Note InnoDB: Starting shutdown.2015-08-28 10:57:04 4981 Note InnoDB: Shutdown completed; log sequence number 16259772015-08-28 10:57:04 0 Warning TIMESTAMP with implicit DEFAULT value is deprecated. Please use -explicit_defaults_for_timestamp server option (see documentation for more details).2015-08-28 10:57:04 0 Note /usr/sbin/mysqld (mysqld 5.6.25-enterprise-commercial-advanced) starting as process 5006 .2015-08-28 10:57:04 5006 Note InnoDB: Using atomics to ref count buffer pool pages2015-08-28 10:57:04 5006 Note InnoDB: The InnoDB memory heap is disabled2015-08-28 10:57:04 5006 Note InnoDB: Mutexes and rw_locks use GCC atomic builtins2015-08-28 10:57:04 5006 Note InnoDB: Memory barrier is not used2015-08-28 10:57:04 5006 Note InnoDB: Compressed tables use zlib 1.2.32015-08-28 10:57:04 5006 Note InnoDB: Using Linux native AIO2015-08-28 10:57:04 5006 Note InnoDB: Using CPU crc32 instructions2015-08-28 10:57:04 5006 Note InnoDB: Initializing buffer pool, size = 128.0M2015-08-28 10:57:04 5006 Note InnoDB: Completed initialization of buffer pool2015-08-28 10:57:04 5006 Note InnoDB: Highest supported file format is Barracuda.2015-08-28 10:57:04 5006 Note InnoDB: 128 rollback segment(s) are active.2015-08-28 10:57:04 5006 Note InnoDB: Waiting for purge to start2015-08-28 10:57:04 5006 Note InnoDB: 5.6.25 started; log sequence number 16259772015-08-28 10:57:04 5006 Note RSA private key file not found: /var/lib/mysql/private_key.pem. Some authentication plugins will not work.2015-08-28 10:57:04 5006 Note RSA public key file not found: /var/lib/mysql/public_key.pem. Some authentication plugins will not work.2015-08-28 10:57:04 5006 Note Binlog end2015-08-28 10:57:04 5006 Note InnoDB: FTS optimize thread exiting.2015-08-28 10:57:04 5006 Note InnoDB: Starting shutdown.2015-08-28 10:57:06 5006 Note InnoDB: Shutdown completed; log sequence number 1625987A 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_installationwhich 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 /The latest information about MySQL is available on the web at Support MySQL by buying support/licenses at New default config file was created as /usr/f andwill be used by default by the server when you start it.You may edit this file to change server settingsrootmysql01 Desktop# cat /root/.mysql_secret# The random password set for the root user at Fri Aug 28 10:57:02 2015 (local time): FY2X3PPff8VzaEn53、配置并启动mysql及设置开机自动启动rootmysql01 Desktop# cp /usr/share/mysql/f /etc/frootmysql01 Desktop# ls -l /etc/f-rwxr-xr-x. 1 root root 1126 Aug 28 11:09 /etc/frootmysql01 Desktop# ps -ef | grep mysqlroot 5369 5167 0 11:10 pts/1 00:00:00 grep mysqlrootmysql01 Desktop# service mysql startStarting MySQL. OK rootmysql01 Desktop# service mysql statusMySQL running (5507) OK rootmysql01 Desktop# chkconfig -list | grep mysqlmysql 0:off1:off2:on3:on4:on5:on6:off备注:如2、3、4为off,即mysql位设置为开机自动启动,可以使用如下方法设置rootmysql01 Desktop# chkconfig -list | grep mysqlmysql 0:off1:off2:off3:off4:off5:off6:offrootmysql01 Desktop# chkconfig -level 2345 mysql onrootmysql01 Desktop# chkconfig -list | grep mysqlmysql 0:off1:off2:on3:on4:on5:on6:off4、登录系统:rootmysql01 Desktop# mysql -uroot -pEnter password: FY2X3PPff8VzaEn5或者:rootmysql01 Desktop# mysql -u root -pEnter password: FY2X3PPff8VzaEn5或者:rootmysql01 Desktop# mysql -uroot -pFY2X3PPff8VzaEn5或者:rootmysql01 Desktop# mysql -u root -pFY2X3PPff8VzaEn5或者:rootmysql01 Desktop# mysql -uroot -pFY2X3PPff8VzaEn5Welcome to the MySQL monitor. Commands end with ; or g.Your MySQL connection id is 18Server version: 5.6.25-enterprise-commercial-advancedCopyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type help; or h for help. Type c to clear the current input statement.mysql show databases;ERROR 1820 (HY000): You must SET PASSWORD before executing this statementmysql set password for rootlocalhost=password(666666)mysql show databases;+-+| Database |+-+| information_schema | mysql | performance_schema | test |+-+4 rows in set (0.04 sec)mysql quitBye或者:mysql exitBye修改登录密码:方法一:rootmysql01 Desktop# mysqladmin -u root -p password 123456Enter password: FY2X3PPff8VzaEn5Warning: Using a password on the command line interface can be insecure.rootmysql01 Desktop# mysql -uroot -p123456 Warning: Using a password on the command line interface can be insecure.Welcome to the MySQL monitor. Commands end with ; or g.Your MySQL connection id is 17Server version: 5.6.25-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial)Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type help; or h for help. Type c to clear the current input statement.mysql show databases;+-+| Database |+-+| information_schema | mysql | performance_schema | test |+-+4 rows in set (0.04 sec)方法二:mysql show databases;+-+| Database |+-+| information_schema | mysql | performance_schema | test |+-+4 rows in set (0.04 sec)mysql update user set password=PASSWORD(666666) where user=root;ERROR 1046 (3D000): No database selectedmysql use mysqlReading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -ADatabase changedmysql update user set password=PASSWORD(666666) where user=root;Query OK, 4 rows affected (0.00 sec)Rows matched: 4 Changed: 4 Warnings: 0mysql flush privileges;Query OK, 0 rows affected (0.00 sec)mysql exitBye步骤三:升级MySQL 5.6.25升级到5.6.26升级安装:1、停服务rootmysql01 Desktop# service mysql statusrootmysql01 Desktop# service mysql stoprootmysql01 Desktop# service mysql status2、备份数据文件rootmysql01 Desktop# mkdir /tmp/mbackuprootmysql01 Desktop# cp /usr/f /tmp/mbackup -a rootmysql01 Desktop# mkdir /tmp/mbackup/datarootmysql01 Desktop# cp -rp /var/lib/mysql/* /tmp/mbackup/data3、解压缩升级版本安装源rootmysql01 Desktop# unzip V77245-01.ziprootmysql01 Desktop# rpm -ivh MySQL-*-5.6.26-* -replacefiles /升级4、升级后更新数据字典:检查升级表rootmysql01 Desktop# service mysql statusMySQL is not running FAILEDrootmysql01 Desktop# service mysql startStarting MySQL. OK rootmysql01 Desktop# service mysql statusMySQL running (19134) OK rootmysql01 Desktop# /usr/bin/mysql_upgrade -S /var/lib/mysql/mysql.sock -uroot -p666666 /操作前一定要确保mysql服务处于启动状态Warning: Using a password on the command line interface can be insecure.Looking for mysql as: /usr/bin/mysqlLooking for mysqlcheck as: /usr/bin/mysqlcheckRunning mysqlcheck with connection arguments: -socket=/var/lib/mysql/mysql.sock Warning: Using a password on the command line interface can be insecure.Running mysqlcheck with connecti

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论