云服务器配置CentOS7.6(⼆)--安装mySQL
⽂章⽬录
1. mysql下载地址
2.下载mysql5.6
2.1 在云服务器上下载mysql5.6
2.2 先下载到本地磁盘。再上传到云服务器
rz -y
如果rz -y 不弹窗,就需要安装
yum install lrzsz -y
先建⽴⼀个mysql5.6⽂件夹,将mysql下载到该⽂件夹中,如下图
3.在安装之前,检查⼀下有没有系统⾃带的mysql相关的rpm⽂件,若有卸载掉
卸载rpm的命令rpm -e 或者rpm -e --nodeps
rpm -qa |grep -i mysql
rpm -e --nodeps mysql-libs-5.1.71-1.el6.x86_64
防⽌系统已经安装了其他版本的mysql-libs包和mysql数据库⽂件导致不兼容。不执⾏这句,mysql可能⽆法启动yum remove mysql-libs
检查⼀下有没有系统⾃带的mysql相关的rpm⽂件,发现有⼀个卸载掉
再次校验
4.开始安装–安装命令
安装命令如下
若安装mysql警告: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY 原因:这是由于yum安装了旧版本的GPG keys造成的
解决办法:后⾯加上
–force --nodeps
rpm -ivh MySQL-client-5.6.47-1.el7.x86_64.rpm --force --nodeps
rpm -ivh MySQL-rver-5.6.47-1.el6.x86_64.rpm --force --nodeps
rpm -ivh MySQL-devel-5.6.47-1.el7.x86_64.rpm --force --nodeps
若还是出现:解决办法 后⾯加上–nosignature
rpm -ivh MySQL-rver-5.6.47-1.el6.x86_64.rpm --nosignature
rpm -ivh MySQL-client-5.6.47-1.el7.x86_64.rpm --nosignature
rpm -ivh MySQL-devel-5.6.47-1.el7.x86_64.rpm --nosignature
若出现以下错误
执⾏以下命令,安装perl依赖
yum install -arch
安装完rver后的信息提⽰
[root@instance-6uz2q7zs home]# rpm -ivh MySQL-rver-5.6.47-1.el6.x86_64.rpm --force --nosignature
< ################################# [100%]
Updating /
1:MySQL-rver-5.6.47-1.el6 ################################# [100%]
warning: ur mysql does not exist - using root
warning: group mysql does not exist - using root
warning: ur mysql does not exist - using root
warning: group mysql does not exist - using root
2020-02-04 13:54:24 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Plea u --explicit_defaults_for_timestamp rver option (e documentation for more details).
2020-02-04 13:54:24 0 [Note] Ignoring --cure-file-priv value as rver is running with --bootstrap.
2020-02-04 13:54:24 0 [Note] /usr/sbin/mysqld (mysqld 5.6.47) starting as process 15276 ...
2020-02-04 13:54:24 15276 [Note] InnoDB: Using atomics to ref count buffer pool pages
2020-02-04 13:54:24 15276 [Note] InnoDB: The InnoDB memory heap is disabled
2020-02-04 13:54:24 15276 [Note] InnoDB: Mutexes and rw_locks u GCC atomic builtins
2020-02-04 13:54:24 15276 [Note] InnoDB: Memory barrier is not ud
2020-02-04 13:54:24 15276 [Note] InnoDB: Compresd tables u zlib 1.2.11
2020-02-04 13:54:24 15276 [Note] InnoDB: Using Linux native AIO
2020-02-04 13:54:24 15276 [Note] InnoDB: Using CPU crc32 instructions
2020-02-04 13:54:24 15276 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2020-02-04 13:54:24 15276 [Note] InnoDB: Completed initialization of buffer pool
2020-02-04 13:54:24 15276 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new databa to be created!
2020-02-04 13:54:24 15276 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2020-02-04 13:54:24 15276 [Note] InnoDB: Databa physically writes the file full:
2020-02-04 13:54:24 15276 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2020-02-04 13:54:25 15276 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2020-02-04 13:54:25 15276 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2020-02-04 13:54:25 15276 [Warning] InnoDB: New log files created, LSN=45781
2020-02-04 13:54:25 15276 [Note] InnoDB: Doublewrite buffer not found: creating new
2020-02-04 13:54:25 15276 [Note] InnoDB: Doublewrite buffer created
2020-02-04 13:54:25 15276 [Note] InnoDB: 128 rollback gment(s) are active.
2020-02-04 13:54:25 15276 [Warning] InnoDB: Creating foreign key constraint system tables.
2020-02-04 13:54:25 15276 [Note] InnoDB: Foreign key constraint system tables created
2020-02-04 13:54:25 15276 [Note] InnoDB: Creating tablespace and datafile system tables.
2020-02-04 13:54:25 15276 [Note] InnoDB: Tablespace and datafile system tables created.
2020-02-04 13:54:25 15276 [Note] InnoDB: Waiting for purge to start
2020-02-04 13:54:25 15276 [Note] InnoDB: 5.6.47 started; log quence number 0
2020-02-04 13:54:25 15276 [Note] InnoDB: 5.6.47 started; log quence number 0
2020-02-04 13:54:25 15276 [Note] RSA private key file not found: /var/lib/mysql//private_key.pem. Some authentication plugins will not work.
2020-02-04 13:54:25 15276 [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 t. You will find it in '/root/.mysql_cret'.
2020-02-04 13:54:25 15276 [Note] Binlog end
2020-02-04 13:54:25 15276 [Note] InnoDB: FTS optimize thread exiting.
2020-02-04 13:54:25 15276 [Note] InnoDB:
2020-02-04 13:54:27 15276 [Note] InnoDB: Shutdown completed; log quence number 1625977
2020-02-04 13:54:27 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Plea u --explicit_defaults_for_timestamp rver option (e documentation for more details).
2020-02-04 13:54:27 0 [Note] Ignoring --cure-file-priv value as rver is running with --bootstrap.
2020-02-04 13:54:27 0 [Note] /usr/sbin/mysqld (mysqld 5.6.47) starting as process 15303 ...
2020-02-04 13:54:27 15303 [Note] InnoDB: Using atomics to ref count buffer pool pages
2020-02-04 13:54:27 15303 [Note] InnoDB: The InnoDB memory heap is disabled
2020-02-04 13:54:27 15303 [Note] InnoDB: Mutexes and rw_locks u GCC atomic builtins
2020-02-04 13:54:27 15303 [Note] InnoDB: Memory barrier is not ud
2020-02-04 13:54:27 15303 [Note] InnoDB: Compresd tables u zlib 1.2.11
2020-02-04 13:54:27 15303 [Note] InnoDB: Using Linux native AIO
2020-02-04 13:54:27 15303 [Note] InnoDB: Using CPU crc32 instructions
2020-02-04 13:54:27 15303 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2020-02-04 13:54:27 15303 [Note] InnoDB: Completed initialization of buffer pool
2020-02-04 13:54:27 15303 [Note] InnoDB: Highest supported file format is Barracuda.
2020-02-04 13:54:27 15303 [Note] InnoDB: 128 rollback gment(s) are active.
2020-02-04 13:54:27 15303 [Note] InnoDB: Waiting for purge to start
2020-02-04 13:54:27 15303 [Note] InnoDB: 5.6.47 started; log quence number 1625977
2020-02-04 13:54:27 15303 [Note] RSA private key file not found: /var/lib/mysql//private_key.pem. Some authentication plugins will not work.
2020-02-04 13:54:27 15303 [Note] RSA public key file not found: /var/lib/mysql//public_key.pem. Some authentication plugins will not work.
2020-02-04 13:54:27 15303 [Note] Binlog end
2020-02-04 13:54:27 15303 [Note] InnoDB: FTS optimize thread exiting.
2020-02-04 13:54:27 15303 [Note] InnoDB:
2020-02-04 13:54:29 15303 [Note] InnoDB: Shutdown completed; log quence number 1625987
A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER !
You will find that password in '/root/.mysql_cret'.
You must change that password on your first connect,
no other statement but 'SET PASSWORD' will be accepted.
See the manual for the mantics of the 'password expired' flag.
Also, the account for the anonymous ur has been removed.
In addition, you can run:
/usr/bin/mysql_cure_installation
which will also give you the option of removing the test databa.
This is strongly recommended for production rvers.
See the manual for more instructions.
Plea report any problems at /
The latest information about MySQL is available on the web at
Support MySQL by buying support/licens at
New default config file was created as /f and
will be ud by default by the rver when you start it.
You may edit this file to change rver ttings
You may edit this file to change rver ttings
WARNING: Default config file /f exists on the system This file will be read by default by the MySQL rver
If you do not want to u this, either remove it, or u the
--defaults-file argument to mysqld_safe when starting the rver
5.开启mysql服务并配置
5.1 开启mysql服务和停⽌mysql服务
rvice mysql start
rvice mysql stop
如下图
我们可以查看进程中有没有mysql
ps -ef | grep mysql