版权声明:本文为博主原创文章,未经博主允许不得转载。
http://dev.mysql.com/downloads/mysql/#downloads
推荐下载通用安装方法的TAR包(http://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.12-linux-glibc2.5-x86_64.tar)。
[root@localhost Desktop]$ rpm -qa | grep mysql
mysql-libs-5.1.52-1.el6_0.1.x86_64
[root@localhost ~]#
[root@localhost ~]# cat /etc/group | grep mysql
mysql:x:490:
[root@localhost ~]# cat /etc/passwd | grep mysql
mysql:x:496:490::/home/mysql:/bin/bash
以上为默认存在的情况,如无,执行添加命令:
[root@localhost ~]#groupadd mysql
[root@localhost ~]#useradd -r -g mysql mysql
//useradd -r参数表示mysql用户是系统用户,不可用于登录系统。
[root@localhost ~]# cd /usr/local/
[root@localhost local]# tar xvf mysql-5.7.12-linux-glibc2.5-x86_64.tar
[root@localhost local]# ls -l
total 1306432
-rwxr--r--. 1 root root 668866560 Jun 1 15:07 mysql-5.7.12-linux-glibc2.5-x86_64.tar
-rw-r--r--. 1 7161 wheel 638960236 Mar 28 12:54 mysql-5.7.12-linux-glibc2.5-x86_64.tar.gz
-rw-r--r--. 1 7161 wheel 29903372 Mar 28 12:48 mysql-test-5.7.12-linux-glibc2.5-x86_64.tar.gz
[root@localhost local]# tar xvfz mysql-5.7.12-linux-glibc2.5-x86_64.tar.gz
[root@localhost local]# mv mysql-5.7.12-linux-glibc2.5-x86_64 mysql
[root@localhost local]# ls -l
total 1306436
drwxr-xr-x. 2 root root 4096 Dec 4 2009 bin
drwxr-xr-x. 2 root root 4096 Dec 4 2009 etc
drwxr-xr-x. 2 root root 4096 Dec 4 2009 games
drwxr-xr-x. 2 root root 4096 Dec 4 2009 include
drwxr-xr-x. 2 root root 4096 Dec 4 2009 lib
drwxr-xr-x. 3 root root 4096 Dec 2 14:36 lib64
drwxr-xr-x. 2 root root 4096 Dec 4 2009 libexec
drwxr-xr-x. 9 7161 wheel 4096 Mar 28 12:51 mysql
-rwxr--r--. 1 root root 668866560 Jun 1 15:07 mysql-5.7.12-linux-glibc2.5-x86_64.tar
-rw-r--r--. 1 7161 wheel 638960236 Mar 28 12:54 mysql-5.7.12-linux-glibc2.5-x86_64.tar.gz
-rw-r--r--. 1 7161 wheel 29903372 Mar 28 12:48 mysql-test-5.7.12-linux-glibc2.5-x86_64.tar.gz
drwxr-xr-x. 2 root root 4096 Dec 4 2009 sbin
drwxr-xr-x. 6 root root 4096 Dec 2 14:36 share
drwxr-xr-x. 2 root root 4096 Dec 4 2009 src
[root@localhost local]# chown -R mysql mysql/
[root@localhost local]# chgrp -R mysql mysql/
[root@localhost mysql]# bin/mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/
2016-06-01 15:23:25 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize
2016-06-01 15:23:30 [WARNING] The bootstrap log isn't empty:
2016-06-01 15:23:30 [WARNING] 2016-06-01T22:23:25.491840Z 0 [Warning]
--bootstrap is deprecated. Please consider using --initialize instead
2016-06-01T22:23:25.492256Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2016-06-01T22:23:25.492260Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
如果改变默认安装路径,则需要
1)/etc/my.cnf、/etc/init.d/mysqld中修改
basedir='/apps/mysql'
datadir='/apps/mysql/data'
2)创建ln
mkdir -p /usr/local/mysql/bin
ln -s /apps/mysql/bin/mysqld /usr/local/mysql/bin/mysqld
----------------------
[root@localhost mysql]# cp -a ./support-files/mysql.server /etc/init.d/mysqld
[root@localhost bin]# ./mysqld_safe --user=mysql &
[1] 2932
[root@localhost bin]# 2016-06-01T22:27:09.708557Z mysqld_safe Logging to '/usr/local/mysql/data/localhost.localdomain.err'.
2016-06-01T22:27:09.854913Z mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
Shutting down MySQL..2016-06-01T22:27:50.498694Z mysqld_safe mysqld from
pid file /usr/local/mysql/data/localhost.localdomain.pid ended
SUCCESS!
Starting MySQL. SUCCESS!
[1]+ Done ./mysqld_safe --user=mysql
[root@localhost bin]#
//设置开机启动
[root@localhost bin]# chkconfig --level 35 mysqld on
[root@localhost bin]#
[root@localhost bin]# cat /root/.mysql_secret
# Password set for user 'root@localhost' at 2016-06-01 15:23:25
,xxxxxR5H9
[root@localhost bin]# ./mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.12
affiliates. Other names may be trademarks of their respective
owners.
Query OK, 0 rows affected, 1 warning (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> update user set host = '%' where user = 'root';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> select host, user from user;
+-----------+-----------+
| host | user |
+-----------+-----------+
| % | root |
| localhost | mysql.sys |
+-----------+-----------+
重启生效
/etc/init.d/mysqld restart
Mysql 5.7 Linux安装详细步骤的更多相关文章
-
Redis在Linux安装详细步骤
一.准备环境: 1.VMware 2.CentOS 3.redis-3.0.4.tar.gz 4.下载地址 Http://redis.io/ 英文版 Http://www.redis.cn/ 中 ...
-
linux下mysql-5.5.15安装详细步骤
linux下mysql-5.5.15安装详细步骤 注:该文档中用到的目录路径以及一些实际的值都是作为例子来用,具体的目录路径以各自安装时的环境为准 mysql运行时需要一个启动目录.一个安装目录和一个 ...
-
linux/centos下安装nginx(rpm安装和源码安装)详细步骤
Centos下安装nginx rpm包 ...
-
MySql Server 5.7的下载及安装详细步骤
1.下载安装包 1)找到官网下载地址(https://dev.mysql.com),选择downloads,找到windows
-
windows10用WMware安装Linux虚拟机详细步骤
windows10用WMware安装Linux虚拟机详细步骤 一.安装环境 windows10操作系统物理机VMware Workstation 软件(可以在网上下载)CentOS6.9镜像文件( ...
-
PostgreSQL在win7上安装详细步骤
原文:PostgreSQL在win7上安装详细步骤 PostgreSQL安装: 一.windows下安装过程 安装介质:postgresql-9.1.3-1-windows.exe(46M),安装过程 ...
-
Linux安装JDK步骤
Linux安装JDK步骤 1.先从官网下载JDK安装包,我下载的是:jdk-8u131-linux-x64.tar.gz版本 2.在usr下创建java文件夹 # mkdir /usr/java 3. ...
-
linux安装jdk7步骤
linux安装jdk7步骤: 1.首先使用命令查看linux系统版本号: lsb_release -a 2.下载对应的jdk版本,笔者使用的是jdk-7u79-linux-x64.tar.gz: 3. ...
-
Linux安装mongoDB步骤和方法
Linux安装mongoDB步骤和方法 下载mongoDB数据库 mongodb-linux-x86_64-3.0.15.tgz 存放到linux文件夹中 ftp软件直接拖上去 解压文件夹(解压后,会 ...
随机推荐
-
[LeetCode] Sliding Window Maximum 滑动窗口最大值
Given an array nums, there is a sliding window of size k which is moving from the very left of the a ...
-
jquery非空验证功能
<script type="text/javascript"> $(function(){ /************* ...
-
Linux字符设备驱动结构(一)--cdev结构体、设备号相关知识机械【转】
本文转载自:http://blog.csdn.net/zqixiao_09/article/details/50839042 一.字符设备基础知识 1.设备驱动分类 linux系统将设备分为3类:字符 ...
-
Android_AutoCompleteTextView,MultiAutoCompleteTextView
XML布局文件 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:an ...
-
hdu1292(递推dp)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1292 分析: i代表人数,j代表组数,有dp[i][j]=dp[i-1][j-1]+dp[i-1 ...
-
基于FPGA的Sobel边缘检测的实现
前面我们实现了使用PC端上位机串口发送图像数据到VGA显示,通过MATLAB处理的图像数据直接是灰度图像,后面我们在此基础上修改,从而实现,基于FPGA的动态图片的Sobel边缘检测.中值滤波.Can ...
-
ios 初体验<;UIButton 控件>;
1.创建UIButton 跟其他方式不同,不是直接alloc,init 创建 用工厂化方式创建 UIButton *sureBtn = [UIButton buttonWithType:UIButto ...
-
TP 3.2.3 接入PHPMailer
TP 3.2.3 接入PHPMailer 项目需要接入邮件发送,这里先记录. 首先在开发这个功能先,您需要先下载个phpmailer的类,这里github 一搜索就有. 如:https://githu ...
-
qt deleterLater
原文链接:浅谈 Qt 内存管理 Qt 内存管理是本文将要介绍的内容,在QT的程序中经常会看到只有new而不delete的情况,其实是因为QT有一套回收内存的机制,主要的规则如下: 1.所有继承 ...
-
php脚本#!/usr/bin/env php 写法
脚本语言的第一行,目的就是指出,你想要你的这个文件中的代码用什么可执行程序去运行它. 比如php脚本的第一行可以写成如下几种格式 #!/usr/bin/php #!/usr/bin/env php # ...