CentOS 6.9安装MySQL 5.6 (使用yum安装)

前端之家收集整理的这篇文章主要介绍了CentOS 6.9安装MySQL 5.6 (使用yum安装)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

本文记录一次在CentOS上安装MysqL的步骤,采用yum安裝的方式~

移除CentOS默认的MysqL-libs

  1. [root@test01 srv]# whereis MysqL
  2. MysqL: /usr/lib64/MysqL /usr/share/MysqL
  3. [root@test01 srv]#

为了避免冲突,先移除CenttOS上默认的MysqL-libs,使用yum remove MysqL-libs完成,如:

  1. [root@test01 srv]# yum remove MysqL-libs
  2. Loaded plugins: fastestmirror
  3. Setting up Remove Process
  4. Resolving Dependencies
  5. --> Running transaction check
  6. ---> Package MysqL-libs.x86_64 0:5.1.73-8.el6_8 will be erased
  7. --> Processing Dependency: libMysqLclient.so.16()(64bit) for package: 2:postfix-2.6.6-8.el6.x86_64
  8. --> Processing Dependency: libMysqLclient.so.16(libMysqLclient_16)(64bit) for package: 2:postfix-2.6.6-8.el6.x86_64
  9. --> Processing Dependency: MysqL-libs for package: 2:postfix-2.6.6-8.el6.x86_64
  10. --> Running transaction check
  11. ---> Package postfix.x86_64 2:2.6.6-8.el6 will be erased
  12. --> Processing Dependency: /usr/sbin/sendmail for package: cronie-1.4.4-16.el6_8.2.x86_64
  13. --> Running transaction check
  14. ---> Package cronie.x86_64 0:1.4.4-16.el6_8.2 will be erased
  15. --> Processing Dependency: cronie = 1.4.4-16.el6_8.2 for package: cronie-anacron-1.4.4-16.el6_8.2.x86_64
  16. --> Running transaction check
  17. ---> Package cronie-anacron.x86_64 0:1.4.4-16.el6_8.2 will be erased
  18. --> Processing Dependency: /etc/cron.d for package: sysstat-9.0.4-33.el6.x86_64
  19. --> Processing Dependency: /etc/cron.d for package: crontabs-1.10-33.el6.noarch
  20. --> Restarting Dependency Resolution with new changes.
  21. --> Running transaction check
  22. ---> Package crontabs.noarch 0:1.10-33.el6 will be erased
  23. ---> Package sysstat.x86_64 0:9.0.4-33.el6 will be erased
  24. --> Finished Dependency Resolution
  25.  
  26. Dependencies Resolved
  27.  
  28. ==============================================================================================================================================================================================================================================================================
  29. Package Arch Version Repository Size
  30. ==============================================================================================================================================================================================================================================================================
  31. Removing:
  32. MysqL-libs x86_64 5.1.73-8.el6_8 @anaconda-CentOS-201703281317.x86_64/6.9 4.0 M
  33. Removing for dependencies:
  34. cronie x86_64 1.4.4-16.el6_8.2 @anaconda-CentOS-201703281317.x86_64/6.9 174 k
  35. cronie-anacron x86_64 1.4.4-16.el6_8.2 @anaconda-CentOS-201703281317.x86_64/6.9 43 k
  36. crontabs noarch 1.10-33.el6 @anaconda-CentOS-201703281317.x86_64/6.9 2.4 k
  37. postfix x86_64 2:2.6.6-8.el6 @anaconda-CentOS-201703281317.x86_64/6.9 9.7 M
  38. sysstat x86_64 9.0.4-33.el6 @ISO 826 k
  39.  
  40. Transaction Summary
  41. ==============================================================================================================================================================================================================================================================================
  42. Remove 6 Package(s)
  43.  
  44. Installed size: 15 M
  45. Is this ok [y/N]:

输入y

  1. Is this ok [y/N]: y
  2. Downloading Packages:
  3. Running rpm_check_debug
  4. Running Transaction Test
  5. Transaction Test Succeeded
  6. Running Transaction
  7. Erasing : sysstat-9.0.4-33.el6.x86_64 1/6
  8. Erasing : cronie-1.4.4-16.el6_8.2.x86_64 2/6
  9. Erasing : cronie-anacron-1.4.4-16.el6_8.2.x86_64 3/6
  10. Erasing : crontabs-1.10-33.el6.noarch 4/6
  11. Erasing : 2:postfix-2.6.6-8.el6.x86_64 5/6
  12. Erasing : MysqL-libs-5.1.73-8.el6_8.x86_64 6/6
  13. Verifying : cronie-anacron-1.4.4-16.el6_8.2.x86_64 1/6
  14. Verifying : cronie-1.4.4-16.el6_8.2.x86_64 2/6
  15. Verifying : 2:postfix-2.6.6-8.el6.x86_64 3/6
  16. Verifying : crontabs-1.10-33.el6.noarch 4/6
  17. Verifying : sysstat-9.0.4-33.el6.x86_64 5/6
  18. Verifying : MysqL-libs-5.1.73-8.el6_8.x86_64 6/6
  19.  
  20. Removed:
  21. MysqL-libs.x86_64 0:5.1.73-8.el6_8
  22.  
  23. Dependency Removed:
  24. cronie.x86_64 0:1.4.4-16.el6_8.2 cronie-anacron.x86_64 0:1.4.4-16.el6_8.2 crontabs.noarch 0:1.10-33.el6 postfix.x86_64 2:2.6.6-8.el6 sysstat.x86_64 0:9.0.4-33.el6
  25.  
  26. Complete!
  27. [root@test01 srv]#

清空dbcache

然后,使用yum clean dbcache清空db缓存,如

  1. [root@test01 srv]# yum clean dbcache
  2. Loaded plugins: fastestmirror
  3. Cleaning repos: ISO
  4. 3 sqlite files removed

下载MysqL rpm安装包

下载MysqL rpm安装包

  1. wget http://repo.MysqL.com/MysqL-community-release-el6-5.noarch.rpm

  1. [root@test01 srv]# wget http://repo.MysqL.com/MysqL-community-release-el6-5.noarch.rpm
  2. --2017-05-08 10:40:29-- http://repo.MysqL.com/MysqL-community-release-el6-5.noarch.rpm
  3. Resolving repo.MysqL.com... 223.119.236.209
  4. Connecting to repo.MysqL.com|223.119.236.209|:80... connected.
  5. HTTP request sent,awaiting response... 200 OK
  6. Length: 5824 (5.7K) [application/x-redhat-package-manager]
  7. Saving to: MysqL-community-release-el6-5.noarch.rpm
  8.  
  9. 100%[====================================================================================================================================================================================================================================>] 5,824 --.-K/s in 0s
  10.  
  11. 2017-05-08 10:40:29 (298 MB/s) - MysqL-community-release-el6-5.noarch.rpm saved [5824/5824]
  12.  
  13. [root@test01 srv]#

安装下载好的rpm文件

使用rpm -ivh MysqL-community-release-el6-5.noarch.rpm安装下载的rpm文件~

  1. [root@test01 srv]# rpm -ivh MysqL-community-release-el6-5.noarch.rpm
  2. Preparing... ########################################### [100%]
  3. 1:MysqL-community-release########################################### [100%]
  4. [root@test01 srv]#

yum安装MysqL-community-server

使用yum install MysqL-community-server安装MysqL server。

  1. [root@test01 srv]# yum install MysqL-community-server
  2. Loaded plugins: fastestmirror
  3. Setting up Install Process
  4. Loading mirror speeds from cached hostfile
  5. MysqL-connectors-community | 2.5 kB 00:00
  6. MysqL-connectors-community/primary_db | 15 kB 00:00
  7. MysqL-tools-community | 2.5 kB 00:00
  8. MysqL-tools-community/primary_db | 35 kB 00:00
  9. MysqL56-community | 2.5 kB 00:00
  10. MysqL56-community/primary_db | 183 kB 00:00
  11. Resolving Dependencies
  12. --> Running transaction check
  13. ---> Package MysqL-community-server.x86_64 0:5.6.36-2.el6 will be installed
  14. --> Processing Dependency: MysqL-community-common(x86-64) = 5.6.36-2.el6 for package: MysqL-community-server-5.6.36-2.el6.x86_64
  15. --> Processing Dependency: MysqL-community-client(x86-64) >= 5.6.10 for package: MysqL-community-server-5.6.36-2.el6.x86_64
  16. --> Processing Dependency: perl(warnings) for package: MysqL-community-server-5.6.36-2.el6.x86_64
  17. --> Processing Dependency: perl(strict) for package: MysqL-community-server-5.6.36-2.el6.x86_64
  18. --> Processing Dependency: perl(if) for package: MysqL-community-server-5.6.36-2.el6.x86_64
  19. --> Processing Dependency: perl(Sys::Hostname) for package: MysqL-community-server-5.6.36-2.el6.x86_64
  20. --> Processing Dependency: perl(POSIX) for package: MysqL-community-server-5.6.36-2.el6.x86_64
  21. --> Processing Dependency: perl(Getopt::Long) for package: MysqL-community-server-5.6.36-2.el6.x86_64
  22. --> Processing Dependency: perl(File::Temp) for package: MysqL-community-server-5.6.36-2.el6.x86_64
  23. --> Processing Dependency: perl(File::Spec) for package: MysqL-community-server-5.6.36-2.el6.x86_64
  24. --> Processing Dependency: perl(File::Path) for package: MysqL-community-server-5.6.36-2.el6.x86_64
  25. --> Processing Dependency: perl(File::Copy) for package: MysqL-community-server-5.6.36-2.el6.x86_64
  26. --> Processing Dependency: perl(File::Basename) for package: MysqL-community-server-5.6.36-2.el6.x86_64
  27. --> Processing Dependency: perl(Fcntl) for package: MysqL-community-server-5.6.36-2.el6.x86_64
  28. --> Processing Dependency: perl(Data::Dumper) for package: MysqL-community-server-5.6.36-2.el6.x86_64
  29. --> Processing Dependency: perl(DBI) for package: MysqL-community-server-5.6.36-2.el6.x86_64
  30. --> Processing Dependency: libnuma.so.1(libnuma_1.2)(64bit) for package: MysqL-community-server-5.6.36-2.el6.x86_64
  31. --> Processing Dependency: libnuma.so.1(libnuma_1.1)(64bit) for package: MysqL-community-server-5.6.36-2.el6.x86_64
  32. --> Processing Dependency: /usr/bin/perl for package: MysqL-community-server-5.6.36-2.el6.x86_64
  33. --> Processing Dependency: libnuma.so.1()(64bit) for package: MysqL-community-server-5.6.36-2.el6.x86_64
  34. --> Running transaction check
  35. ---> Package MysqL-community-client.x86_64 0:5.6.36-2.el6 will be installed
  36. --> Processing Dependency: MysqL-community-libs(x86-64) >= 5.6.10 for package: MysqL-community-client-5.6.36-2.el6.x86_64
  37. ---> Package MysqL-community-common.x86_64 0:5.6.36-2.el6 will be installed
  38. ---> Package numactl.x86_64 0:2.0.9-2.el6 will be installed
  39. ---> Package perl.x86_64 4:5.10.1-144.el6 will be installed
  40. --> Processing Dependency: perl-libs = 4:5.10.1-144.el6 for package: 4:perl-5.10.1-144.el6.x86_64
  41. --> Processing Dependency: perl-libs for package: 4:perl-5.10.1-144.el6.x86_64
  42. --> Processing Dependency: perl(version) for package: 4:perl-5.10.1-144.el6.x86_64
  43. --> Processing Dependency: perl(Pod::Simple) for package: 4:perl-5.10.1-144.el6.x86_64
  44. --> Processing Dependency: perl(Module::Pluggable) for package: 4:perl-5.10.1-144.el6.x86_64
  45. --> Processing Dependency: libperl.so()(64bit) for package: 4:perl-5.10.1-144.el6.x86_64
  46. ---> Package perl-DBI.x86_64 0:1.609-4.el6 will be installed
  47. --> Running transaction check
  48. ---> Package MysqL-community-libs.x86_64 0:5.6.36-2.el6 will be installed
  49. ---> Package perl-Module-Pluggable.x86_64 1:3.90-144.el6 will be installed
  50. ---> Package perl-Pod-Simple.x86_64 1:3.13-144.el6 will be installed
  51. --> Processing Dependency: perl(Pod::Escapes) >= 1.04 for package: 1:perl-Pod-Simple-3.13-144.el6.x86_64
  52. ---> Package perl-libs.x86_64 4:5.10.1-144.el6 will be installed
  53. ---> Package perl-version.x86_64 3:0.77-144.el6 will be installed
  54. --> Running transaction check
  55. ---> Package perl-Pod-Escapes.x86_64 1:1.04-144.el6 will be installed
  56. --> Finished Dependency Resolution
  57.  
  58. Dependencies Resolved
  59.  
  60. ==============================================================================================================================================================================================================================================================================
  61. Package Arch Version Repository Size
  62. ==============================================================================================================================================================================================================================================================================
  63. Installing:
  64. MysqL-community-server x86_64 5.6.36-2.el6 MysqL56-community 55 M
  65. Installing for dependencies:
  66. MysqL-community-client x86_64 5.6.36-2.el6 MysqL56-community 18 M
  67. MysqL-community-common x86_64 5.6.36-2.el6 MysqL56-community 308 k
  68. MysqL-community-libs x86_64 5.6.36-2.el6 MysqL56-community 1.9 M
  69. numactl x86_64 2.0.9-2.el6 ISO 74 k
  70. perl x86_64 4:5.10.1-144.el6 ISO 10 M
  71. perl-DBI x86_64 1.609-4.el6 ISO 705 k
  72. perl-Module-Pluggable x86_64 1:3.90-144.el6 ISO 41 k
  73. perl-Pod-Escapes x86_64 1:1.04-144.el6 ISO 33 k
  74. perl-Pod-Simple x86_64 1:3.13-144.el6 ISO 213 k
  75. perl-libs x86_64 4:5.10.1-144.el6 ISO 579 k
  76. perl-version x86_64 3:0.77-144.el6 ISO 52 k
  77.  
  78. Transaction Summary
  79. ==============================================================================================================================================================================================================================================================================
  80. Install 12 Package(s)
  81.  
  82. Total download size: 87 M
  83. Installed size: 373 M
  84. Is this ok [y/N]:

选择y

  1. Is this ok [y/N]: y
  2. Downloading Packages:
  3. (1/12): MysqL-community-client-5.6.36-2.el6.x86_64.rpm | 18 MB 00:01
  4. (2/12): MysqL-community-common-5.6.36-2.el6.x86_64.rpm | 308 kB 00:00
  5. (3/12): MysqL-community-libs-5.6.36-2.el6.x86_64.rpm | 1.9 MB 00:00
  6. (4/12): MysqL-community-server-5.6.36-2.el6.x86_64.rpm | 55 MB 00:03
  7. (5/12): numactl-2.0.9-2.el6.x86_64.rpm | 74 kB 00:00
  8. (6/12): perl-5.10.1-144.el6.x86_64.rpm | 10 MB 00:00
  9. (7/12): perl-DBI-1.609-4.el6.x86_64.rpm | 705 kB 00:00
  10. (8/12): perl-Module-Pluggable-3.90-144.el6.x86_64.rpm | 41 kB 00:00
  11. (9/12): perl-Pod-Escapes-1.04-144.el6.x86_64.rpm | 33 kB 00:00
  12. (10/12): perl-Pod-Simple-3.13-144.el6.x86_64.rpm | 213 kB 00:00
  13. (11/12): perl-libs-5.10.1-144.el6.x86_64.rpm | 579 kB 00:00
  14. (12/12): perl-version-0.77-144.el6.x86_64.rpm | 52 kB 00:00
  15. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  16. Total 14 MB/s | 87 MB 00:06
  17. warning: rpmts_HdrFromFdno: Header V3 DSA/SHA1 Signature,key ID 5072e1f5: NOKEY
  18. Retrieving key from file:/etc/pki/rpm-gpg/RPM-GPG-KEY-MysqL
  19. Importing GPG key 0x5072E1F5:
  20. Userid : MysqL Release Engineering <MysqL-build@oss.oracle.com>
  21. Package: MysqL-community-release-el6-5.noarch (installed)
  22. From : file:/etc/pki/rpm-gpg/RPM-GPG-KEY-MysqL
  23. Is this ok [y/N]:

选择y

  1. Is this ok [y/N]: y
  2. Running rpm_check_debug
  3. Running Transaction Test
  4. Transaction Test Succeeded
  5. Running Transaction
  6. Warning: RPMDB altered outside of yum.
  7. Installing : MysqL-community-common-5.6.36-2.el6.x86_64 1/12
  8. Installing : MysqL-community-libs-5.6.36-2.el6.x86_64 2/12
  9. Installing : 1:perl-Pod-Escapes-1.04-144.el6.x86_64 3/12
  10. Installing : 4:perl-libs-5.10.1-144.el6.x86_64 4/12
  11. Installing : 1:perl-Module-Pluggable-3.90-144.el6.x86_64 5/12
  12. Installing : 1:perl-Pod-Simple-3.13-144.el6.x86_64 6/12
  13. Installing : 3:perl-version-0.77-144.el6.x86_64 7/12
  14. Installing : 4:perl-5.10.1-144.el6.x86_64 8/12
  15. Installing : perl-DBI-1.609-4.el6.x86_64 9/12
  16. Installing : MysqL-community-client-5.6.36-2.el6.x86_64 10/12
  17. Installing : numactl-2.0.9-2.el6.x86_64 11/12
  18. Installing : MysqL-community-server-5.6.36-2.el6.x86_64 12/12
  19. Verifying : 3:perl-version-0.77-144.el6.x86_64 1/12
  20. Verifying : 4:perl-libs-5.10.1-144.el6.x86_64 2/12
  21. Verifying : 4:perl-5.10.1-144.el6.x86_64 3/12
  22. Verifying : numactl-2.0.9-2.el6.x86_64 4/12
  23. Verifying : MysqL-community-common-5.6.36-2.el6.x86_64 5/12
  24. Verifying : perl-DBI-1.609-4.el6.x86_64 6/12
  25. Verifying : MysqL-community-server-5.6.36-2.el6.x86_64 7/12
  26. Verifying : MysqL-community-libs-5.6.36-2.el6.x86_64 8/12
  27. Verifying : MysqL-community-client-5.6.36-2.el6.x86_64 9/12
  28. Verifying : 1:perl-Module-Pluggable-3.90-144.el6.x86_64 10/12
  29. Verifying : 1:perl-Pod-Simple-3.13-144.el6.x86_64 11/12
  30. Verifying : 1:perl-Pod-Escapes-1.04-144.el6.x86_64 12/12
  31.  
  32. Installed:
  33. MysqL-community-server.x86_64 0:5.6.36-2.el6
  34.  
  35. Dependency Installed:
  36. MysqL-community-client.x86_64 0:5.6.36-2.el6 MysqL-community-common.x86_64 0:5.6.36-2.el6 MysqL-community-libs.x86_64 0:5.6.36-2.el6 numactl.x86_64 0:2.0.9-2.el6 perl.x86_64 4:5.10.1-144.el6 perl-DBI.x86_64 0:1.609-4.el6
  37. perl-Module-Pluggable.x86_64 1:3.90-144.el6 perl-Pod-Escapes.x86_64 1:1.04-144.el6 perl-Pod-Simple.x86_64 1:3.13-144.el6 perl-libs.x86_64 4:5.10.1-144.el6 perl-version.x86_64 3:0.77-144.el6
  38.  
  39. Complete!
  40. [root@test01 srv]#

启动服务

service MysqLd start

  1. [root@test01 srv]# service MysqLd start
  2. Initializing MysqL database: 2017-05-08 11:06:09 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
  3. 2017-05-08 11:06:09 0 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
  4. 2017-05-08 11:06:09 0 [Note] /usr/sbin/MysqLd (MysqLd 5.6.36) starting as process 926 ...
  5. 2017-05-08 11:06:09 926 [Note] InnoDB: Using atomics to ref count buffer pool pages
  6. 2017-05-08 11:06:09 926 [Note] InnoDB: The InnoDB memory heap is disabled
  7. 2017-05-08 11:06:09 926 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
  8. 2017-05-08 11:06:09 926 [Note] InnoDB: Memory barrier is not used
  9. 2017-05-08 11:06:09 926 [Note] InnoDB: Compressed tables use zlib 1.2.3
  10. 2017-05-08 11:06:09 926 [Note] InnoDB: Using Linux native AIO
  11. 2017-05-08 11:06:09 926 [Note] InnoDB: Not using cpu crc32 instructions
  12. 2017-05-08 11:06:09 926 [Note] InnoDB: Initializing buffer pool,size = 128.0M
  13. 2017-05-08 11:06:09 926 [Note] InnoDB: Completed initialization of buffer pool
  14. 2017-05-08 11:06:09 926 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
  15. 2017-05-08 11:06:09 926 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
  16. 2017-05-08 11:06:09 926 [Note] InnoDB: Database physically writes the file full: wait...
  17. 2017-05-08 11:06:09 926 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
  18. 2017-05-08 11:06:09 926 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
  19. 2017-05-08 11:06:09 926 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
  20. 2017-05-08 11:06:09 926 [Warning] InnoDB: New log files created,LSN=45781
  21. 2017-05-08 11:06:09 926 [Note] InnoDB: Doublewrite buffer not found: creating new
  22. 2017-05-08 11:06:09 926 [Note] InnoDB: Doublewrite buffer created
  23. 2017-05-08 11:06:09 926 [Note] InnoDB: 128 rollback segment(s) are active.
  24. 2017-05-08 11:06:09 926 [Warning] InnoDB: Creating foreign key constraint system tables.
  25. 2017-05-08 11:06:09 926 [Note] InnoDB: Foreign key constraint system tables created
  26. 2017-05-08 11:06:09 926 [Note] InnoDB: Creating tablespace and datafile system tables.
  27. 2017-05-08 11:06:09 926 [Note] InnoDB: Tablespace and datafile system tables created.
  28. 2017-05-08 11:06:09 926 [Note] InnoDB: Waiting for purge to start
  29. 2017-05-08 11:06:09 926 [Note] InnoDB: 5.6.36 started; log sequence number 0
  30. 2017-05-08 11:06:09 926 [Note] Binlog end
  31. 2017-05-08 11:06:09 926 [Note] InnoDB: FTS optimize thread exiting.
  32. 2017-05-08 11:06:09 926 [Note] InnoDB: Starting shutdown...
  33. 2017-05-08 11:06:11 926 [Note] InnoDB: Shutdown completed; log sequence number 1625977
  34.  
  35.  
  36. 2017-05-08 11:06:11 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
  37. 2017-05-08 11:06:11 0 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
  38. 2017-05-08 11:06:11 0 [Note] /usr/sbin/MysqLd (MysqLd 5.6.36) starting as process 948 ...
  39. 2017-05-08 11:06:11 948 [Note] InnoDB: Using atomics to ref count buffer pool pages
  40. 2017-05-08 11:06:11 948 [Note] InnoDB: The InnoDB memory heap is disabled
  41. 2017-05-08 11:06:11 948 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
  42. 2017-05-08 11:06:11 948 [Note] InnoDB: Memory barrier is not used
  43. 2017-05-08 11:06:11 948 [Note] InnoDB: Compressed tables use zlib 1.2.3
  44. 2017-05-08 11:06:11 948 [Note] InnoDB: Using Linux native AIO
  45. 2017-05-08 11:06:11 948 [Note] InnoDB: Not using cpu crc32 instructions
  46. 2017-05-08 11:06:11 948 [Note] InnoDB: Initializing buffer pool,size = 128.0M
  47. 2017-05-08 11:06:11 948 [Note] InnoDB: Completed initialization of buffer pool
  48. 2017-05-08 11:06:11 948 [Note] InnoDB: Highest supported file format is Barracuda.
  49. 2017-05-08 11:06:11 948 [Note] InnoDB: 128 rollback segment(s) are active.
  50. 2017-05-08 11:06:11 948 [Note] InnoDB: Waiting for purge to start
  51. 2017-05-08 11:06:11 948 [Note] InnoDB: 5.6.36 started; log sequence number 1625977
  52. 2017-05-08 11:06:11 948 [Note] Binlog end
  53. 2017-05-08 11:06:11 948 [Note] InnoDB: FTS optimize thread exiting.
  54. 2017-05-08 11:06:11 948 [Note] InnoDB: Starting shutdown...
  55. 2017-05-08 11:06:13 948 [Note] InnoDB: Shutdown completed; log sequence number 1625987
  56.  
  57.  
  58.  
  59.  
  60. PLEASE REMEMBER TO SET A PASSWORD FOR THE MysqL root USER !
  61. To do so,start the server,then issue the following commands:
  62.  
  63. /usr/bin/MysqLadmin -u root password 'new-password'
  64. /usr/bin/MysqLadmin -u root -h test01.znyj.interconnect password 'new-password'
  65.  
  66. Alternatively you can run:
  67.  
  68. /usr/bin/MysqL_secure_installation
  69.  
  70. which will also give you the option of removing the test
  71. databases and anonymous user created by default. This is
  72. strongly recommended for production servers.
  73.  
  74. See the manual for more instructions.
  75.  
  76. Please report any problems at http://bugs.MysqL.com/
  77.  
  78. The latest information about MysqL is available on the web at
  79.  
  80. http://www.MysqL.com
  81.  
  82. Support MysqL by buying support/licenses at http://shop.MysqL.com
  83.  
  84. Note: new default config file not created.
  85. Please make sure your config file is current
  86.  
  87. WARNING: Default config file /etc/my.cnf exists on the system
  88. This file will be read by default by the MysqL server
  89. If you do not want to use this,either remove it,or use the
  90. --defaults-file argument to MysqLd_safe when starting the server
  91.  
  92. [ OK ]
  93. Starting MysqLd: [ OK ]
  94. [root@test01 srv]#

修改密码

默认密码是空的~使用MysqL -uroot进入~

  1. [root@test01 srv]# MysqL -uroot
  2. Welcome to the MysqL monitor. Commands end with ; or \g.
  3. Your MysqL connection id is 2
  4. Server version: 5.6.36 MysqL Community Server (GPL)
  5.  
  6. Copyright (c) 2000,2017,Oracle and/or its affiliates. All rights reserved.
  7.  
  8. Oracle is a registered trademark of Oracle Corporation and/or its
  9. affiliates. Other names may be trademarks of their respective
  10. owners.
  11.  
  12. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  13.  
  14. MysqL>

修改密码~

使用update user set password=PASSWORD("YOUR_PASSWORD") where user='root';修改root账号密码~

  1. MysqL> use MysqL;
  2. Reading table information for completion of table and column names
  3. You can turn off this feature to get a quicker startup with -A
  4.  
  5. Database changed
  6. MysqL> update user set password=PASSWORD("YOUR_PASSWORD") where user='root'
  7. -> ;
  8. Query OK,4 rows affected (0.00 sec)
  9. Rows matched: 4 Changed: 4 Warnings: 0
  10.  
  11. MysqL> flush privileges;
  12. Query OK,0 rows affected (0.00 sec)
  13.  
  14. MysqL>

密码验证

重新登录MysqL服务,验证修改后的密码~

  1. MysqL> quit
  2. Bye
  3. [root@test01 srv]# MysqL -uroot
  4. ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
  5. [root@test01 srv]# MysqL -uroot -p
  6. Enter password:
  7. Welcome to the MysqL monitor. Commands end with ; or \g.
  8. Your MysqL connection id is 4
  9. Server version: 5.6.36 MysqL Community Server (GPL)
  10.  
  11. Copyright (c) 2000,Oracle and/or its affiliates. All rights reserved.
  12.  
  13. Oracle is a registered trademark of Oracle Corporation and/or its
  14. affiliates. Other names may be trademarks of their respective
  15. owners.
  16.  
  17. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  18.  
  19. MysqL>

至此,MysqL安装完毕~

猜你在找的CentOS相关文章