mysql 5.7.19 二进制最新安装

首先从官网下载zip archive版本http://dev.mysql.com/downloads/mysql/

MySQL v5.7.19 官方正式版(32/64位 安装版与zip解压版)

一、优化部分

1.操作系统参数调优

2.数据库参数调优

3.防火墙设置等

#############################

二、安装部分

1.创建用户和组

# groupadd mysql
# useradd -g mysql mysql

2.创建数据库安装目录、授权

# mkdir /mysql /mysql/data /mysql/log
# chown -R mysql:mysql /usr/local/mysql 

3.到安装目录,解压安装文件

#cd /usr/local
# tar -zxvf mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz
# mv mysql-5.7.19-linux-glibc2.12-x86_64 mysql

4.授权

# chown -R mysql.mysql mysql

5.验证权限

# ls -l mysql
total 52
drwxr-xr-x 2 mysql mysql 4096 Aug 8 04:06 bin
-rw-r--r-- 1 mysql mysql 17987 Jun 22 22:13 COPYING
drwxr-xr-x 2 mysql mysql 4096 Aug 8 04:06 docs
drwxr-xr-x 3 mysql mysql 4096 Aug 8 04:06 include
drwxr-xr-x 5 mysql mysql 4096 Aug 8 04:06 lib
drwxr-xr-x 4 mysql mysql 4096 Aug 8 04:06 man
-rw-r--r-- 1 mysql mysql 2478 Jun 22 22:13 README
drwxr-xr-x 28 mysql mysql 4096 Aug 8 04:06 share
drwxr-xr-x 2 mysql mysql 4096 Aug 8 04:06 support-files

6.编辑参数文件

vim /etc/my.cnf
[client]
port = 3306
socket = /tmp/mysql.sock
[mysqld]
server_id=10
port = 3306
user = mysql
character-set-server = utf8mb4
default_storage_engine = innodb
log_timestamps = SYSTEM
socket = /tmp/mysql.sock
basedir = /usr/local/mysql
datadir = /mysql/data
pid-file = /mysql/data/mysql.pid
max_connections = 1000
max_connect_errors = 1000
table_open_cache = 1024
max_allowed_packet = 128M
open_files_limit = 65535
#####====================================[innodb]==============================
innodb_buffer_pool_size = 1024M
innodb_file_per_table = 1
innodb_write_io_threads = 4
innodb_read_io_threads = 4
innodb_purge_threads = 2
innodb_flush_log_at_trx_commit = 1
innodb_log_file_size = 512M
innodb_log_files_in_group = 2
innodb_log_buffer_size = 16M
innodb_max_dirty_pages_pct = 80
innodb_lock_wait_timeout = 30
innodb_data_file_path=ibdata1:1024M:autoextend
innodb_undo_tablespaces=3
#####====================================[log]==============================
log_error = /mysql/log/mysql-error.log
slow_query_log = 1
long_query_time = 1
slow_query_log_file = /mysql/log/mysql-slow.log
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

7.安装数据库

# ./bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/mysql/data --innodb_undo_tablespaces=3 --explicit_defaults_for_timestamp

8.配置启动文件

cp support-files/mysql.server /etc/init.d/mysql
chkconfig --add mysql
chkconfig mysql on
service mysql start

9.配置环境变量

vi /etc/profile
#for mysql
mysql_home=/usr/local/mysql
PATH=$PATH:$mysql_home/bin
source /etc/profile

10.查看默认密码

grep -i password /mysql/log/mysql-error.log 

11.初始化密码

mysql -uroot -p‘xxxxx‘
SET PASSWORD=PASSWORD(‘root‘);
flush privileges;

12.数据库常规启停

# mysqladmin -uroot -proot shutdown
#mysqld_safe --defaults-file=/etc/my.cnf &
#ps -ef|grep mysql

13.安全配置

# mysql_secure_installation
Securing the MySQL server deployment.
Enter password for user root:
VALIDATE PASSWORD PLUGIN can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD plugin?
Press y|Y for Yes, any other key for No: y
There are three levels of password validation policy:
LOW  Length >= 8
MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary         file
Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 2
Using existing password for root.
Estimated strength of the password: 25
Change the password for root ? ((Press y|Y for Yes, any other key for No) : y
New password:
Re-enter new password:
Sorry, passwords do not match.
New password:
Re-enter new password:
Sorry, passwords do not match.
New password:
Re-enter new password:
Estimated strength of the password: 50
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
 ... Failed! Error: Your password does not satisfy the current policy requirements
New password:
Re-enter new password:
Estimated strength of the password: 100
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.
Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Success.
Normally, root should only be allowed to connect from
‘localhost‘. This ensures that someone cannot guess at
the root password from the network.
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
Success.
By default, MySQL comes with a database named ‘test‘ that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
 - Dropping test database...
Success.
 - Removing privileges on test database...
Success.
Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
Success.
All done! 

相关阅读:

Mysql在各个系统的安装教程

Mysql 5.7.19 免安装版配置方法教程详解(64位)

Mysql 5.7.19 免安装版遇到的坑(收藏)

MySQL 5.7.19安装目录下创建my.ini文件的方法

总结

以上所述是小编给大家介绍的mysql 5.7.19 二进制最新安装,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对我们网站的支持!

(0)

相关推荐

  • Linux下Centos7安装Mysql5.7.19的详细教程

    1.下载mysql 网址: https://dev.mysql.com/downloads/mysql/ 2.选择源码包,通用版点击下载 直接下载就可以了,不用登录 3.解压编译 tar -zxvf mysql-5.7.19.tar.gz cd mysql-5.7.19.tar.gz 创建数据目录  mkdir -p /data/mysql 先用cmake编译,没有这个命令需要先yum安装 cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql/ #这个是编译

  • Mysql 5.7.19 免安装版配置方法教程详解(64位)

    官方网站下载mysql-5.7.19-winx64,注意对应系统64位或者32位,这里使用的是64位. 解压放置到本地磁盘.发现文件很大,大概是1.6G左右.删除lib文件夹下的.lib文件和debug文件夹下所有文件. 在主目录下创建my.ini文件,文件内容如下:(这里是简洁版,对应本机修改basedir和datadir的目录,根据需要可以自己扩充配置) [client] port=3306 default-character-set=utf8 [mysqld] basedir=D:\Jav

  • linux下多个mysql5.7.19(tar.gz)安装图文教程

    初级第一次在Linux下安装MySQL-5.7.19版本教程请看上一篇,如果已经会安装了,那么请看这篇linux下安装多个mysql-5.7.19 环境:centos 6.5 1-下载 2-跳过登陆 3-1安装多个数据库需要配置自己的my.cnf,如果只安装一个,系统没有安装过直接这个命令就可以 shell> groupadd mysql shell> useradd -r -g mysql -s /bin/false mysql shell> cd /usr/local shell&g

  • Mysql 5.7.19 winx64 ZIP Archive 安装及使用过程问题小结

    今天学着安装了MySQL,过程出现了一些问题,查看几个相关文章后解决了,记录下来供大家参考. 1.下载 https://dev.mysql.com/downloads/mysql/ http://www.jb51.net/softs/451120.html 选择适合自己的版本,Archive表示下载后直接解压即可,不许安装,比较方便. 2.在MySQL的根目录下新建文件my.ini(之前是没有的),在文件里添加以下内容. [mysql] # 设置mysql客户端默认字符集 default-cha

  • linux下mysql5.7.19(tar.gz)安装图文教程

    初级第一次在linux下安装mysql-5.7.19版本教程,如果已经会安装了,那么请看下一篇linux下安装多个mysql-5.7.19 环境:centos 6.5 1.下载 2.跳过登陆 3.上传并解压到目录../usr/local/mysql-5.7.19-3307 复制代码 代码如下: tar -zxvf mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz  -C ../usr/local/mysql5.7.19-3307 4.添加系统mysql组和my

  • Mysql 5.7.19 免安装版遇到的坑(收藏)

    1.从官网下载64位zip文件. 2.把zip解压到一个位置,此位置为安装为安装位置 3.如果有以前的mysql 如果是install的,去控制面板卸载,还需要删除以前mysql留下来的残留文件.如果是免安装的,用mysqld -remove命令删除 ,卸载以前的文件记得要保留里面的data文件夹和my.ini文件.(data文件里面的东西可以恢复用:my.ini文件里面是配置参考配置) 以前有mysql服务的话 需要去停掉mysql服务 4.新建一个my.ini文件.里面内容和以前一样.要修改

  • mysql5.7.19 winx64安装配置方法图文教程(win10)

    mysql 5.7.19 winx64安装教程记录如下,分享给大家 step1 官方下载地址:https://dev.mysql.com/downloads/mysql/ 选择手动下载版本 解压到自己指定的路径 上图中的my.ini及data文件夹在压缩包里是没有的,后面需要自己添加 my.ini 如下,直接copy~ [client] port=3306 default-character-set=utf8 [mysqld] # 设置为自己MYSQL的安装目录 basedir=D:\Mysql

  • Linux下安装MySQL5.7.19问题小结

    第一次在自己虚机上安装mysql 中间碰到很多问题 在这里记下来,分享一下. linux centOS 6 mysql版本 mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz 1.groupadd mysql      ## 添加一个mysql组 2.useradd -r -g mysql mysql    ## 添加一个用户 3.解压缩下载的包,tar -xzvf /usr/local/mysql-5.7.13-linux-glibc2.5-x86_64.ta

  • mysql5.7.19 安装配置方法图文教程(win10)

    WIN10系统MYSQL的下载与安装详细教程,记录如下 前两天ubuntu下安装mysql遇到了一些依赖问题,结果解决了半天,没解决好,还把我的系统搞坏了,小白破坏力好强. 到现在我的ubuntu也没装好,电脑驱动的问题,联想小新310一装ubuntu,进去就卡,原来禁用原先的显卡驱动,可是第二次装系统,中间又搞了其他小动作,结果再装上系统后,禁用显卡驱动也不行了.只能先装win10用了,不料win10下安装Mysql又出现了问题,真是一波未平一波又起.解决了好长时间,所以写个博客记录一下吧.

  • 最新版MySQL5.7.19解压版安装指南

    MySQL版本:MySQL Community Edition (GPL)   ------  MySQL Community Server (GPL) 下载地址:https://dev.mysql.com/downloads/mysql/ http://www.jb51.net/softs/451120.html 下载文件:mysql-5.7.19-winx64.zip 下载完成后,解压, 1 配置环境变量  将mysql/bin  加入到PATH中 2 使用cmd工具或者powershell

  • MySQL 5.7.19安装目录下创建my.ini文件的方法

    在上篇文章给大家介绍了Mysql 5.7.19 免安装版配置方法教程详解(64位),本文重点给大家介绍MySQL 5.7.19安装目录下创建my.ini文件的方法,大家可以参考下. 基本内容如下 [mysqld] character-set-server=utf8 #绑定IPv4和3306端口 bind-address = 0.0.0.0 port = 3306 # 设置mysql的安装目录 basedir=F:/test/mysql-5.7.19-winx64 # 设置mysql数据库的数据的

随机推荐