下载
wget http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-5.7.23-1.el6.x86_64.rpm-bundle.tar
解压:
tar xvf mysql-5.7.23-1.el6.x86_64.rpm-bundle.tar
rpm卸载
rpm -qa | grep -i mysql
rpm -ev mysql-community-libs-5.7.23-1.el6.x86_64 --nodeps
mysql安装需要提前安装
yum install numactl
yum install libaio
安装顺序
$ rpm -ivh mysql-community-common-5.7.19-1.el6.x86_64.rpm
$ rpm -ivh mysql-community-libs-5.7.19-1.el6.x86_64.rpm
$ rpm -ivh mysql-community-clients-5.7.19-1.el6.x86_64.rpm
$ rpm -ivh mysql-community-server-5.7.19-1.el6.x86_64.rpm
安装错误提示
file /usr/share/mysql/charsets/koi8u.xml from install of mysql-community-common-5.7.23-1.el6.x86_64 conflicts with file from package mariadb-libs-1:5.5.52-1.el7.x86_64
file /usr/share/mysql/charsets/latin1.xml from install of mysql-community-common-5.7.23-1.el6.x86_64 conflicts with file from package mariadb-libs-1:5.5.52-1.el7.x86_64
file /usr/share/mysql/charsets/latin2.xml from install of mysql-community-common-5.7.23-1.el6.x86_64 conflicts with file from package mariadb-libs-1:5.5.52-1.el7.x86_64
file /usr/share/mysql/charsets/latin5.xml from install of mysql-community-common-5.7.23-1.el6.x86_64 conflicts with file from package mariadb-libs-1:5.5.52-1.el7.x86_64
file /usr/share/mysql/charsets/latin7.xml from install of mysql-community-common-5.7.23-1.el6.x86_64 conflicts with file from package mariadb-libs-1:5.5.52-1.el7.x86_64
file /usr/share/mysql/charsets/macce.xml from install of mysql-community-common-5.7.23-1.el6.x86_64 conflicts with file from package mariadb-libs-1:5.5.52-1.el7.x86_64
file /usr/share/mysql/charsets/macroman.xml from install of mysql-community-common-5.7.23-1.el6.x86_64 conflicts with file from package mariadb-libs-1:5.5.52-1.el7.x86_64
file /usr/share/mysql/charsets/swe7.xml from install of mysql-community-common-5.7.23-1.el6.x86_64 conflicts with file from package mariadb-libs-1:5.5.52-1.el7.x86_64
解决办法
[root@VM_0_3_centos mysql]# rpm -qa | grep -i mariadb
mariadb-libs-5.5.52-1.el7.x86_64
删除此包后在安装
[root@VM_0_3_centos mysql]# rpm -ev --nodeps mariadb-libs-5.5.52-1.el7.x86_64
Preparing packages...
mariadb-libs-1:5.5.52-1.el7.x86_64
[root@VM_0_3_centos mysql]# rpm -qa | grep -i mariadb
[root@VM_0_3_centos mysql]# rpm -ivh mysql-community-common-5.7.23-1.el6.x86_64.rpm
warning: mysql-community-common-5.7.23-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:mysql-community-common-5.7.23-1.e################################# [100%]
[root@VM_0_3_centos mysql]#
应用
[root@centos-linux ~]# rpm -qa|grep mariadb
mariadb-libs-5.5.44-2.el7.centos.x86_64
[root@centos-linux ~]# rpm -e mariadb-libs-5.5.44-2.el7.centos.x86_64 --nodeps
启动
# service mysqld start
# service mysqld stop
# service mysqld status
密码
[root@VM_0_3_centos my]# cat /var/log/mysqld.log | more
2019-02-03T10:10:08.730690Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --e
xplicit_defaults_for_timestamp server option (see documentation for more details).
2019-02-03T10:10:09.863484Z 0 [Warning] InnoDB: New log files created, LSN=45790
2019-02-03T10:10:10.038902Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2019-02-03T10:10:10.106619Z 0 [Warning] No existing UUID has been found, so we assume that this is the firs
t time that this server has been started. Generating a new UUID: e375b165-279b-11e9-9261-52540054f857.
2019-02-03T10:10:10.110315Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' can
not be opened.
2019-02-03T10:10:10.110788Z 1 [Note] A temporary password is generated for root@localhost: :&rCz7/GOk:a
2019-02-03T10:10:14.771770Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --e
xplicit_defaults_for_timestamp server option (see documentation for more details).
2019-02-03T10:10:14.772914Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.16) starting as process 18364 ...
2019-02-03T10:10:14.775764Z 0 [Note] InnoDB: PUNCH HOLE support available
2019-02-03T10:10:14.775789Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-02-03T10:10:14.775794Z 0 [Note] InnoDB: Uses event mutexes
2019-02-03T10:10:14.775798Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2019-02-03T10:10:14.775801Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2019-02-03T10:10:14.775804Z 0 [Note] InnoDB: Using Linux native AIO
2019-02-03T10:10:14.775996Z 0 [Note] InnoDB: Number of pools: 1
2019-02-03T10:10:14.776115Z 0 [Note] InnoDB: Using CPU crc32 instructions
2019-02-03T10:10:14.777475Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, ch
unk size = 128M
2019-02-03T10:10:14.784915Z 0 [Note] InnoDB: Completed initialization of buffer pool
2019-02-03T10:10:14.786867Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner threa
d priority can be changed. See the man page of setpriority().
2019-02-03T10:10:14.798574Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2019-02-03T10:10:14.812389Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2019-02-03T10:10:14.812450Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the
file full; Please wait ...
2019-02-03T10:10:14.857969Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2019-02-03T10:10:14.859259Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s)
are active.
2019-02-03T10:10:14.859273Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2019-02-03T10:10:14.860073Z 0 [Note] InnoDB: Waiting for purge to start
2019-02-03T10:10:14.910321Z 0 [Note] InnoDB: 5.7.16 started; log sequence number 2532180
2019-02-03T10:10:14.910612Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
[root@VM_0_3_centos my]#
登陆mysql
[root@VM_0_3_centos my]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.7.16
Copyright (c) 2000, 2016, 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> show databases;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.