MySQL 5.7.15 安装 (二进制版本)
发表于:2025-11-07 作者:千家信息网编辑
千家信息网最后更新 2025年11月07日,0.创建mysql用户和组信息[root@gxoradb1 ~]# groupadd mysql[root@gxoradb1 ~]# useradd -r -g mysql -s /bin/false
千家信息网最后更新 2025年11月07日MySQL 5.7.15 安装 (二进制版本)
0.创建mysql用户和组信息
[root@gxoradb1 ~]# groupadd mysql[root@gxoradb1 ~]# useradd -r -g mysql -s /bin/false mysql
1.指定安装目录
[root@gxoradb1 ~]# cd /usr/local[root@gxoradb1 local]# lsmysql-advanced-5.7.15-linux-glibc2.5-x86_64.tar.gz
2.解压mysql
[root@gxoradb1 local]# tar -zxvf mysql-advanced-5.7.15-linux-glibc2.5-x86_64.tar.gz [root@gxoradb1 local]# mv mysql-advanced-5.7.15-linux-glibc2.5-x86_64/ mysql-5.7.15[root@gxoradb1 local]# ln -s mysql-5.7.15 mysql[root@gxoradb1 local]# ls -lalrwxrwxrwx 1 root root 12 Oct 4 14:58 mysql -> mysql-5.7.15drwxr-xr-x 9 root root 4096 Oct 4 14:56 mysql-5.7.15
3.调整目录权限
[root@gxoradb1 local]# cd mysql[root@gxoradb1 mysql]# mkdir mysql-files[root@gxoradb1 mysql]# chmod 750 mysql-files[root@gxoradb1 mysql]# chown -R mysql:mysql .
The mysql-files directory provides a convenient location to use as the value of the secure_file_priv system variable that limits import/export operations to a specific directory.
4.初始化mysql
[root@gxoradb1 mysql]# bin/mysqld --initialize --user=mysql2016-10-04T07:07:05.044029Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).2016-10-04T07:07:05.351321Z 0 [Warning] InnoDB: New log files created, LSN=457902016-10-04T07:07:05.396915Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.2016-10-04T07:07:05.454329Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 2825c52a-8a01-11e6-abb2-080027b5eb23.2016-10-04T07:07:05.456104Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.2016-10-04T07:07:06.265334Z 0 [Warning] CA certificate ca.pem is self signed.2016-10-04T07:07:06.503976Z 1 [Note] A temporary password is generated for root@localhost: <5Tk+Gs7frb7 //临时口令[root@gxoradb1 mysql]# bin/mysql_ssl_rsa_setup
5.调整目录权限
[root@gxoradb1 mysql]# chown -R root .[root@gxoradb1 mysql]# chown -R mysql data mysql-files
6.启动mysql
[root@gxoradb1 mysql]# bin/mysqld_safe --user=mysql &[1] 11211[root@gxoradb1 mysql]# 2016-10-04T07:10:20.032700Z mysqld_safe Logging to '/usr/local/mysql/data/gxoradb1.err'.2016-10-04T07:10:20.058270Z mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
7.创建自启动脚本
[root@gxoradb1 mysql]# cp support-files/mysql.server /etc/init.d/mysql.server[root@gxoradb1 mysql]# chkconfig --add mysql.server[root@gxoradb1 mysql]# chkconfig --list mysql.server mysql.server 0:off 1:off 2:on 3:on 4:on 5:on 6:off
8.登录mysql数据库
[root@gxoradb1 ~]# mysql -u root -h localhost -pEnter password: Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 5Server version: 5.7.15-enterprise-commercial-advancedCopyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
9.修改root用户口令
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'oracle';
mysql> set password for 'root'@'localhost'=password('oracle');官方文档中对二进制安装的说明
shell> yum install libaio //安装libaio包
shell> groupadd mysqlshell> useradd -r -g mysql -s /bin/false mysqlshell> cd /usr/localshell> tar zxvf /path/to/mysql-VERSION-OS.tar.gzshell> ln -s full-path-to-mysql-VERSION-OS mysqlshell> cd mysqlshell> mkdir mysql-filesshell> chmod 750 mysql-filesshell> chown -R mysql .shell> chgrp -R mysql .shell> bin/mysql_install_db --user=mysql # Before MySQL 5.7.6shell> bin/mysqld --initialize --user=mysql # MySQL 5.7.6 and upshell> bin/mysql_ssl_rsa_setup # MySQL 5.7.6 and upshell> chown -R root .shell> chown -R mysql data mysql-filesshell> bin/mysqld_safe --user=mysql Next command is optionalshell> cp support-files/mysql.server /etc/init.d/mysql.server
| Directory | Contents of Directory |
|---|---|
bin,scripts | mysqld server, client and utility programs |
data | Log files, databases |
docs | MySQL manual in Info format |
man | Unix manual pages |
include | Include (header) files |
lib | Libraries |
share | Miscellaneous support files, including error messages, sample configuration files, SQL for database installation |
目录
口令
权限
用户
调整
二进制
信息
官方
数据
数据库
文档
脚本
登录
版本
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
九台区有名的网络技术售后服务
国家安全数据库
从事计算机网络技术方面
荣誉战魂 服务器
黑龙江电信dns服务器虚拟主机
软件开发鼻通器
程序员跟软件开发工程师
服务器域名访问不了
英雄联盟服务器停止响应怎么办
网络安全靠大家快板词
什么是数据库的架构
世界最好的网络数据库
argo高级服务器
收录中国专利的数据库有哪些
计算机网络技术专升本浙江
在软件开发中常遇的问题
医疗审计软件开发
联志服务器厂家
数据库怎么重复插入数据
邯郸第三方软件开发价钱是多少
个人网络安全知识考试
广州o2o电商软件开发
新建一个新的数据库快捷键
命令复制数据库
软件开发业务流程怎么画
信用卡APP代还软件开发
blender软件开发时间
群辉服务器
丽水市信息网络安全协会
网络安全法刷题答案