国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 數(shù)據(jù)庫(kù) > MySQL > 正文

Linux下安裝Mysql

2024-07-24 12:31:37
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友
      訪問(wèn)oracle官方網(wǎng)站下載 如下文件:
      MySQL-server-5.6.20-1.el6.x86_64.rpm
      MySQL-devel-5.6.20-1.el6.x86_64.rpm
      MySQL-client-5.6.20-1.el6.x86_64.rpm
然后在Linux中使用root賬號(hào)執(zhí)行安裝:
[root@Hadoop mysql]# rpm -ivh MySQL-server-5.6.20-1.el6.x86_64.rpm
Preparing... ########################################### [100%]
    file /usr/share/mysql/czech/errmsg.sys from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/danish/errmsg.sys from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/dutch/errmsg.sys from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/english/errmsg.sys from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/estonian/errmsg.sys from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/french/errmsg.sys from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/german/errmsg.sys from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/greek/errmsg.sys from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/hungarian/errmsg.sys from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/italian/errmsg.sys from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/japanese/errmsg.sys from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/korean/errmsg.sys from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/norwegian-ny/errmsg.sys from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/norwegian/errmsg.sys from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/polish/errmsg.sys from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/portuguese/errmsg.sys from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/romanian/errmsg.sys from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/russian/errmsg.sys from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/serbian/errmsg.sys from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/slovak/errmsg.sys from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/spanish/errmsg.sys from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/swedish/errmsg.sys from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/ukrainian/errmsg.sys from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/charsets/Index.xml from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/charsets/armscii8.xml from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/charsets/ascii.xml from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/charsets/cp1250.xml from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/charsets/cp1256.xml from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/charsets/cp1257.xml from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/charsets/cp850.xml from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/charsets/cp852.xml from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/charsets/cp866.xml from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/charsets/dec8.xml from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/charsets/geostd8.xml from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/charsets/greek.xml from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/charsets/hebrew.xml from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/charsets/hp8.xml from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/charsets/keybcs2.xml from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/charsets/koi8r.xml from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/charsets/koi8u.xml from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/charsets/latin1.xml from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/charsets/latin2.xml from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/charsets/latin5.xml from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/charsets/latin7.xml from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/charsets/macce.xml from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/charsets/macroman.xml from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/share/mysql/charsets/swe7.xml from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
    file /usr/bin/my_print_defaults from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-5.1.66-2.el6_3.x86_64
    file /usr/share/man/man1/my_print_defaults.1.gz from install of MySQL-server-5.6.20-1.el6.x86_64 conflicts with file from package mysql-5.1.66-2.el6_3.x86_64
出現(xiàn)conflicts,解決辦法如下:
[root@Hadoop mysql]# yum -y remove mysql-libs-5.1.66*
Loaded plugins: refresh-packagekit, security
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package mysql-libs.x86_64 0:5.1.66-2.el6_3 will be erased
--> Processing Dependency: libmysqlclient.so.16()(64bit) for package: mysql-devel-5.1.66-2.el6_3.x86_64
--> Processing Dependency: libmysqlclient.so.16()(64bit) for package: 2:postfix-2.6.6-2.2.el6_1.x86_64
--> Processing Dependency: libmysqlclient.so.16()(64bit) for package: mysql-5.1.66-2.el6_3.x86_64
--> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: 2:postfix-2.6.6-2.2.el6_1.x86_64
--> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: mysql-5.1.66-2.el6_3.x86_64
--> Processing Dependency: libmysqlclient_r.so.16()(64bit) for package: mysql-devel-5.1.66-2.el6_3.x86_64
--> Processing Dependency: libmysqlclient_r.so.16()(64bit) for package: mysql-5.1.66-2.el6_3.x86_64
--> Processing Dependency: libmysqlclient_r.so.16(libmysqlclient_16)(64bit) for package: mysql-5.1.66-2.el6_3.x86_64
--> Processing Dependency: mysql-libs for package: 2:postfix-2.6.6-2.2.el6_1.x86_64
--> Processing Dependency: mysql-libs = 5.1.66-2.el6_3 for package: mysql-5.1.66-2.el6_3.x86_64
--> Running transaction check
---> Package mysql.x86_64 0:5.1.66-2.el6_3 will be erased
---> Package mysql-devel.x86_64 0:5.1.66-2.el6_3 will be erased
---> Package postfix.x86_64 2:2.6.6-2.2.el6_1 will be erased
--> Processing Dependency: /usr/sbin/sendmail for package: cronie-1.4.4-7.el6.x86_64
--> Processing Dependency: /usr/sbin/sendmail for package: redhat-lsb-core-4.0-7.0.1.el6.x86_64
--> Running transaction check
---> Package cronie.x86_64 0:1.4.4-7.el6 will be erased
--> Processing Dependency: cronie = 1.4.4-7.el6 for package: cronie-anacron-1.4.4-7.el6.x86_64
---> Package redhat-lsb-core.x86_64 0:4.0-7.0.1.el6 will be erased
--> Processing Dependency: redhat-lsb-core(x86-64) = 4.0 for package: redhat-lsb-graphics-4.0-7.0.1.el6.x86_64
--> Processing Dependency: redhat-lsb-core(x86-64) = 4.0-7.0.1.el6 for package: redhat-lsb-4.0-7.0.1.el6.x86_64
--> Processing Dependency: redhat-lsb-core(x86-64) = 4.0 for package: redhat-lsb-printing-4.0-7.0.1.el6.x86_64
--> Running transaction check
---> Package cronie-anacron.x86_64 0:1.4.4-7.el6 will be erased
---> Package redhat-lsb.x86_64 0:4.0-7.0.1.el6 will be erased
--> Processing Dependency: redhat-lsb(x86-64) = 4.0-7.0.1.el6 for package: redhat-lsb-compat-4.0-7.0.1.el6.x86_64
---> Package redhat-lsb-graphics.x86_64 0:4.0-7.0.1.el6 will be erased
---> Package redhat-lsb-printing.x86_64 0:4.0-7.0.1.el6 will be erased
--> Running transaction check
---> Package redhat-lsb-compat.x86_64 0:4.0-7.0.1.el6 will be erased
--> Processing Dependency: /etc/cron.d for package: crontabs-1.10-33.el6.noarch
--> Processing Dependency: /etc/cron.d for package: sysstat-9.0.4-20.el6.x86_64
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package crontabs.noarch 0:1.10-33.el6 will be erased
---> Package sysstat.x86_64 0:9.0.4-20.el6 will be erased
--> Finished Dependency Resolution
 
Dependencies Resolved
 
============================================================================================================================================================
 Package Arch Version Repository Size
============================================================================================================================================================
Removing:
 mysql-libs x86_64 5.1.66-2.el6_3 @anaconda-OracleLinuxServer-201302251503.x86_64/6.4 4.0 M
Removing for dependencies:
 cronie x86_64 1.4.4-7.el6 @anaconda-OracleLinuxServer-201302251503.x86_64/6.4 166 k
 cronie-anacron x86_64 1.4.4-7.el6 @anaconda-OracleLinuxServer-201302251503.x86_64/6.4 43 k
 crontabs noarch 1.10-33.el6 @anaconda-OracleLinuxServer-201302251503.x86_64/6.4 2.4 k
 mysql x86_64 5.1.66-2.el6_3 @anaconda-OracleLinuxServer-201302251503.x86_64/6.4 2.4 M
 mysql-devel x86_64 5.1.66-2.el6_3 @anaconda-OracleLinuxServer-201302251503.x86_64/6.4 387 k
 postfix x86_64 2:2.6.6-2.2.el6_1 @anaconda-OracleLinuxServer-201302251503.x86_64/6.4 9.7 M
 redhat-lsb x86_64 4.0-7.0.1.el6 @anaconda-OracleLinuxServer-201302251503.x86_64/6.4 0.0
 redhat-lsb-compat x86_64 4.0-7.0.1.el6 @anaconda-OracleLinuxServer-201302251503.x86_64/6.4 0.0
 redhat-lsb-core x86_64 4.0-7.0.1.el6 @anaconda-OracleLinuxServer-201302251503.x86_64/6.4 22 k
 redhat-lsb-graphics x86_64 4.0-7.0.1.el6 @anaconda-OracleLinuxServer-201302251503.x86_64/6.4 0.0
 redhat-lsb-printing x86_64 4.0-7.0.1.el6 @anaconda-OracleLinuxServer-201302251503.x86_64/6.4 0.0
 sysstat x86_64 9.0.4-20.el6 @anaconda-OracleLinuxServer-201302251503.x86_64/6.4 807 k
 
Transaction Summary
============================================================================================================================================================
Remove 13 Package(s)
 
Installed size: 17 M
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Erasing : redhat-lsb-compat-4.0-7.0.1.el6.x86_64 1/13
  Erasing : redhat-lsb-4.0-7.0.1.el6.x86_64 2/13
  Erasing : mysql-devel-5.1.66-2.el6_3.x86_64 3/13
  Erasing : redhat-lsb-graphics-4.0-7.0.1.el6.x86_64 4/13
  Erasing : redhat-lsb-printing-4.0-7.0.1.el6.x86_64 5/13
  Erasing : redhat-lsb-core-4.0-7.0.1.el6.x86_64 6/13
  Erasing : mysql-5.1.66-2.el6_3.x86_64 7/13
/var/tmp/rpm-tmp.aSJ8EY: line 1: lsb_release: command not found
  Erasing : sysstat-9.0.4-20.el6.x86_64 8/13
  Erasing : crontabs-1.10-33.el6.noarch 9/13
  Erasing : cronie-anacron-1.4.4-7.el6.x86_64 10/13
  Erasing : cronie-1.4.4-7.el6.x86_64 11/13
  Erasing : 2:postfix-2.6.6-2.2.el6_1.x86_64 12/13
  Erasing : mysql-libs-5.1.66-2.el6_3.x86_64 13/13
  Verifying : mysql-devel-5.1.66-2.el6_3.x86_64 1/13
  Verifying : redhat-lsb-printing-4.0-7.0.1.el6.x86_64 2/13
  Verifying : 2:postfix-2.6.6-2.2.el6_1.x86_64 3/13
  Verifying : redhat-lsb-4.0-7.0.1.el6.x86_64 4/13
  Verifying : redhat-lsb-core-4.0-7.0.1.el6.x86_64 5/13
  Verifying : mysql-5.1.66-2.el6_3.x86_64 6/13
  Verifying : cronie-anacron-1.4.4-7.el6.x86_64 7/13
  Verifying : redhat-lsb-compat-4.0-7.0.1.el6.x86_64 8/13
  Verifying : crontabs-1.10-33.el6.noarch 9/13
  Verifying : sysstat-9.0.4-20.el6.x86_64 10/13
  Verifying : mysql-libs-5.1.66-2.el6_3.x86_64 11/13
  Verifying : cronie-1.4.4-7.el6.x86_64 12/13
  Verifying : redhat-lsb-graphics-4.0-7.0.1.el6.x86_64 13/13
 
Removed:
  mysql-libs.x86_64 0:5.1.66-2.el6_3
 
Dependency Removed:
  cronie.x86_64 0:1.4.4-7.el6 cronie-anacron.x86_64 0:1.4.4-7.el6 crontabs.noarch 0:1.10-33.el6
  mysql.x86_64 0:5.1.66-2.el6_3 mysql-devel.x86_64 0:5.1.66-2.el6_3 postfix.x86_64 2:2.6.6-2.2.el6_1
  redhat-lsb.x86_64 0:4.0-7.0.1.el6 redhat-lsb-compat.x86_64 0:4.0-7.0.1.el6 redhat-lsb-core.x86_64 0:4.0-7.0.1.el6
  redhat-lsb-graphics.x86_64 0:4.0-7.0.1.el6 redhat-lsb-printing.x86_64 0:4.0-7.0.1.el6 sysstat.x86_64 0:9.0.4-20.el6
 
Complete!
我這里用的虛擬機(jī)是兩塊網(wǎng)卡,一塊host-only,一塊NAT,加了NAT以后就可以使用yum的方式去解決沖突了。
然后繼續(xù)安裝
[root@Hadoop mysql]# rpm -ivh MySQL-server-5.6.20-1.el6.x86_64.rpm
Preparing... ########################################### [100%]
   1:MySQL-server ########################################### [100%]
2016-05-30 11:07:08 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-05-30 11:07:08 2893 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-05-30 11:07:08 2893 [Note] InnoDB: The InnoDB memory heap is disabled
2016-05-30 11:07:08 2893 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-05-30 11:07:08 2893 [Note] InnoDB: Memory barrier is not used
2016-05-30 11:07:08 2893 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-05-30 11:07:08 2893 [Note] InnoDB: Using Linux native AIO
2016-05-30 11:07:08 2893 [Note] InnoDB: Using CPU crc32 instructions
2016-05-30 11:07:08 2893 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-05-30 11:07:08 2893 [Note] InnoDB: Completed initialization of buffer pool
2016-05-30 11:07:08 2893 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2016-05-30 11:07:08 2893 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2016-05-30 11:07:08 2893 [Note] InnoDB: Database physically writes the file full: wait...
2016-05-30 11:07:08 2893 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2016-05-30 11:07:10 2893 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2016-05-30 11:07:11 2893 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2016-05-30 11:07:11 2893 [Warning] InnoDB: New log files created, LSN=45781
2016-05-30 11:07:11 2893 [Note] InnoDB: Doublewrite buffer not found: creating new
2016-05-30 11:07:11 2893 [Note] InnoDB: Doublewrite buffer created
2016-05-30 11:07:11 2893 [Note] InnoDB: 128 rollback segment(s) are active.
2016-05-30 11:07:11 2893 [Warning] InnoDB: Creating foreign key constraint system tables.
2016-05-30 11:07:11 2893 [Note] InnoDB: Foreign key constraint system tables created
2016-05-30 11:07:11 2893 [Note] InnoDB: Creating tablespace and datafile system tables.
2016-05-30 11:07:11 2893 [Note] InnoDB: Tablespace and datafile system tables created.
2016-05-30 11:07:11 2893 [Note] InnoDB: Waiting for purge to start
2016-05-30 11:07:11 2893 [Note] InnoDB: 5.6.20 started; log sequence number 0
A random root password has been set. You will find it in '/root/.mysql_secret'.
2016-05-30 11:07:12 2893 [Note] Binlog end
2016-05-30 11:07:12 2893 [Note] InnoDB: FTS optimize thread exiting.
2016-05-30 11:07:12 2893 [Note] InnoDB: Starting shutdown...
2016-05-30 11:07:13 2893 [Note] InnoDB: Shutdown completed; log sequence number 1625977
  
2016-05-30 11:07:13 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-05-30 11:07:13 2915 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-05-30 11:07:13 2915 [Note] InnoDB: The InnoDB memory heap is disabled
2016-05-30 11:07:13 2915 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-05-30 11:07:13 2915 [Note] InnoDB: Memory barrier is not used
2016-05-30 11:07:13 2915 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-05-30 11:07:13 2915 [Note] InnoDB: Using Linux native AIO
2016-05-30 11:07:13 2915 [Note] InnoDB: Using CPU crc32 instructions
2016-05-30 11:07:13 2915 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-05-30 11:07:13 2915 [Note] InnoDB: Completed initialization of buffer pool
2016-05-30 11:07:13 2915 [Note] InnoDB: Highest supported file format is Barracuda.
2016-05-30 11:07:13 2915 [Note] InnoDB: 128 rollback segment(s) are active.
2016-05-30 11:07:13 2915 [Note] InnoDB: Waiting for purge to start
2016-05-30 11:07:13 2915 [Note] InnoDB: 5.6.20 started; log sequence number 1625977
2016-05-30 11:07:14 2915 [Note] Binlog end
2016-05-30 11:07:14 2915 [Note] InnoDB: FTS optimize thread exiting.
2016-05-30 11:07:14 2915 [Note] InnoDB: Starting shutdown...
2016-05-30 11:07:15 2915 [Note] InnoDB: Shutdown completed; log sequence number 1625987
  
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
[root@Hadoop mysql]# rpm -ivh MySQL-client-5.6.20-1.el6.x86_64.rpm
Preparing... ########################################### [100%]
   1:MySQL-client ########################################### [100%]
[root@Hadoop mysql]# rpm -ivh MySQL-devel-5.6.20-1.el6.x86_64.rpm
Preparing... ########################################### [100%]
   1:MySQL-devel ########################################### [100%]
安裝完成后啟動(dòng)mysql服務(wù)
[root@Hadoop mysql]# service mysql start
Starting MySQL. SUCCESS!
查看root的隨機(jī)密碼
[root@Hadoop ~]# cat /root/.mysql_secret
# The random password set for the root user at Mon May 30 11:07:12 2016 (local time): wSerJnbKa2UxlRqR
登陸mysql
[root@Hadoop bin]# mysql -u root -pwSerJnbKa2UxlRqR
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 5
Server version: 5.6.20
 
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
 
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
 
Type 'help;' or '/h' for help. Type '/c' to clear the current input statement.
 
mysql>
修改密碼
mysql> UPDATE user SET Password=PASSWORD('root') where USER='root';
Query OK, 4 rows affected (0.00 sec)
Rows matched: 4 Changed: 4 Warnings: 0
 
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
設(shè)置遠(yuǎn)程登陸 方法1:
mysql>use mysql;
mysql>update user set host = '%' where user = 'root';
mysql> select host,user from user;
+-----------+------+
| host | user |
+-----------+------+
| % | root |
| 127.0.0.1 | root |
| ::1 | root |
| hadoop | root |
+-----------+------+
4 rows in set (0.00 sec)
方法2:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'youpassword' WITH GRANT OPTIO
之后就可以嘗試遠(yuǎn)程登陸,果然就成功率
C:/Users/lnwxzyp>mysql -uroot -proot -h292.168.56.101
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 2
Server version: 5.6.20 MySQL Community Server (GPL)
 
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
 
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
 
Type 'help;' or '/h' for help. Type '/c' to clear the current input statement.
 
mysql>
在安裝過(guò)程中,由于在修改了密碼之后沒(méi)有刷新權(quán)限,并且對(duì)mysql進(jìn)行了重啟,結(jié)果造成登陸的時(shí)候出現(xiàn) 如下錯(cuò)誤
[root@Hadoop bin]# mysql -uroot -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
這種情況下,需要設(shè)置跳過(guò)驗(yàn)證表
[root@Hadoop bin]# mysqld_safe --skip-grant-tables
160530 14:28:31 mysqld_safe Logging to '/var/lib/mysql/Hadoop.err'.
160530 14:28:32 mysqld_safe A mysqld process already exists
然后就可以 mysql -u root mysql 方式登陸了,另外開(kāi)一個(gè)終端
[root@Hadoop ~]# mysql -u root mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
 
Welcome to the MySQL monitor. Commands end with ; or /g.
Your MySQL connection id is 2
Server version: 5.6.20 MySQL Community Server (GPL)
 
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
 
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
 
Type 'help;' or '/h' for help. Type '/c' to clear the current input statement.
 
mysql> UPDATE user SET Password=PASSWORD('root') where USER='root';
Query OK, 4 rows affected (0.00 sec)
Rows matched: 4 Changed: 4 Warnings: 0
 
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
 
mysql> quit;
Bye
[root@Hadoop ~]#
然后重啟mysql之后就正常了。

(編輯:武林網(wǎng))

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 长治县| 乌兰察布市| 五原县| 安化县| 库车县| 论坛| 丘北县| 商城县| 固阳县| 孟州市| 佛冈县| 吉林市| 融水| 南涧| 大足县| 安化县| 吴桥县| 奎屯市| 商城县| 惠州市| 阿拉尔市| 乐陵市| 安西县| 盖州市| 利川市| 津市市| 纳雍县| 桓仁| 阿荣旗| 紫阳县| 左云县| 偏关县| 南华县| 城口县| 平遥县| 巴楚县| 辛集市| 霍林郭勒市| 巴彦淖尔市| 巨鹿县| 新巴尔虎左旗|