mysql8.0绿色版安装及mysqldump备份

1、下载mysql绿色版压缩包
https://dev.mysql.com/downloads/mysql/

2、解压到安装目录后,在根目录创建data文件夹

3、把mysql下的bin目录添加到环境变量

4、根目录创建my.ini文件,并拷贝以下代码,并修改basedir和datadir路径

# MySQL Server Instance Configuration File
# ----------------------------------------------------------------------
# Generated by the MySQL Server Instance Configuration Wizard
#
#
# Installation Instructions
# ----------------------------------------------------------------------
#
# On Linux you can copy this file to /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options
# (@localstatedir@ for this installation) or to
# ~/.my.cnf to set user-specific options.
#
# On Windows you should keep this file in the installation directory
# of your server (e.g. C:\Program Files\MySQL\MySQL Server X.Y). To
# make sure the server reads the config file use the startup option
# "--defaults-file".
#
# To run run the server from the command line, execute this in a
# command line shell, e.g.
# mysqld --defaults-file="D:\GreenSoft\MySQL\my.ini"
#
# To install the server as a Windows service manually, execute this in a
# command line shell, e.g.
# mysqld --install mysql --defaults-file="D:\GreenSoft\MySQL\my.ini"
#
# And then execute this in a command line shell to start the server, e.g.
# net start mysql
#
#
# Guildlines for editing this file
# ----------------------------------------------------------------------
#
# In this file, you can use all long options that the program supports.
# If you want to know the options a program supports, start the program
# with the "--help" option.
#
# More detailed information about the individual options can also be
# found in the manual.
#
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/8.0/en/server-configuration-defaults.html
#
#
# CLIENT SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by MySQL client applications.
# Note that only client applications shipped by MySQL are guaranteed
# to read this section. If you want your own MySQL client program to
# honor these values, you need to specify it as an option during the
# MySQL client library initialization.
#

[client]
no-beep

# pipe
# socket=0.0
port=3306

[mysql]

default-character-set=utf8

[mysqld]

# 这是8.0.4的新特性 caching_sha2_password,在linux上面使用命宁 mysql -uroot -proot 可以链接,但是使用windows下面的navict链接不成功
default_authentication_plugin = mysql_native_password

# These are commonly set, remove the # and set as required.
character-set-server = utf8
basedir = D:\Program Files\mysql-8.0.11-winx64
datadir = D:\Program Files\mysql-8.0.11-winx64\data
port = 3306
server_id = 1

# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
innodb_buffer_pool_size = 128M

# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin

# General and Slow logging.
log-output=FILE
general-log=0
general_log_file="CUPID.log"
slow-query-log=1
slow_query_log_file="CUPID-slow.log"
long_query_time=10

# Binary Logging.
# log-bin

# Error Logging.
log-error="CUPID.err"

# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M 

# 8.0.4版本的时候,用的是这个sql_mode,但在8.0.11版本中会报错,改成下面那个
# sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
sql-mode="STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION"

default-storage-engine=INNODB

innodb_log_file_size = 512M
binlog_format=‘MIXED‘
max_allowed_packet = 1G
# innodb_file_per_table = 1
# innodb_file_format = Barracuda

# 大小写是否敏感,0敏感 Linux下默认为0, Windows下默认值是 1, MacOS下默认值是 2(0敏感)
lower_case_table_names = 1

innodb_strict_mode = 0
max_connections = 500

5、mysqld --install   //安装MYSQL服务

6、mysqld --initialize --user=mysql --console     //初始化mysql,并记下临时密码

7、net start mysql   //启动mysql服务

8、SET PASSWORD = ‘123456‘;    //修改密码
或者使用   ALTER USER ‘root‘@‘localhost‘ IDENTIFIED BY ‘123456‘;

9、CREATE USER ‘username‘@‘host‘ IDENTIFIED BY ‘password‘;  (创建异地登录用户)

例:CREATE USER ‘backup‘@‘10.0.0.2‘ IDENTIFIED BY ‘123456‘;  (用户名为backup,密码123456,只允许10.0.0.2远程登录)

10、GRANT privileges ON databasename.tablename TO ‘username‘@‘host‘;(用户授权)

例:GRANT select,lock tables ON db1.* TO ‘backup‘@‘%‘;(授权db1数据库的select和lock tables权限给backup用户)



客户端下使用mysqldump备份

1、下载mysql绿色版,解压后,进入bin目录(客户端可以不用安装服务和初始化)

2、mysqldump -h主机名  -P端口 -u用户名 -p密码  数据库名 > 文件名.sql

mysqldump -h10.0.0.1  -P3310 -ubackup -p123456  db1 > db1.sql (备份db1数据库并保存为db1.sql文件)



安装mysql过程中,出现过的报错

1、丢失MSVCP140.DLL
解决方法:安装VC++2015运行库

2、安装VC++2015运行库失败
解决方法:控制面板-》Windows更新,更新到最新补丁

原文地址:https://www.cnblogs.com/zhenwei66/p/10507978.html

时间: 2024-10-04 21:25:26

mysql8.0绿色版安装及mysqldump备份的相关文章

微信小程序(原名微信应用号)开发工具0.9版安装教程

微信小程序全称微信公众平台·小程序,原名微信公众平台·应用号(简称微信应用号) 声明 微信小程序开发工具类似于一个轻量级的IDE集成开发环境,目前仅开放给了少部分受微信官方邀请的人士(据说仅200个名额)进行内测,因此目前未受到邀请的人士只能使用破解版: 本破解版资源来自于网上,与本人无关,仅供技术开发人员研究之用: 由于尚属内测阶段,因此迭代更新非常快,后续很可能由于升级而导致暂时无法使用.   特别注意 由于目前发布的0.9版本必须验证才能登录(估计是为了验证是否为内测人士),因此必须先下载

CentOS 6.6 MySQL 5.5.32 绿色版安装配置

MySQL 5.5.32 绿色版安装配置 基本信息 系统版本:CentOS 6.6 MySQL版本:5.5.32 绿色版 初始化MySQL,出现黄色部分两个OK,表示初始化正确 [[email protected] tools]# useradd -s/sbin/nologin -M mysql [[email protected] tools]# tar zxvfmysql-5.5.32-linux2.6-x86_64.tar.gz [[email protected] tools]# mvm

mysql绿色版安装

mysql绿色版安装流程 1.下载mysql:http://www.mysql.com/downloads/ 2.配置环境变量. 1)新建变量: 变量名:MYSQL_HMOE 变量值:为mysql的绝对路径 2)把新建的变量加入到path中: 在path的值得最前加入%MYSQL_HOME%\bin; 3.cmd命令安装: 1)打开cmd,输入安装命令:mysqld -install 提示安装成功! 2) 初始化mysql,输入命令:mysql -initialize 3)配置my.ini(请填

【Vegas原创】Mysql绿色版安装方法

原文:[Vegas原创]Mysql绿色版安装方法 所谓的绿色版,就是没有installer的MySQL,完全需要靠人工来操作,好处是,重装系统后,只要再做一次本次配置,即可使用. 具体操作方法: 1,设置系统环境变量, 在Path中添加 D:\mysql\bin 2,修改my-small.ini文件内容,添加以下内容 basedir=D:\mysql datadir=D:\mysql\data 修改后,另存为my.ini 3.安装MySQL的服务,服务名自己定义为MySQL. 1).进入DOS窗

mysql绿色版安装问题解决(ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061))

原来一直是使用MySQL安装版没有出现过问题,今天在安装绿色版MySQL时出现了点问题 在安装成windows服务成功后,用net start mysql 启动时提示启动成功,但当我连接mysql就报以下错误: ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061) my.ini文件内容: [mysqld]basedir=E://databases//mysqldatadir=F://databases//

xTiNt 论坛发帖辅助软件 1.0 绿色版

软件名称:xTiNt 论坛发帖辅助软件 1.0 绿色版软件语言: 简体中文授权方式: 免费软件应用平台: Win7 / Vista / Win2003 / WinXP / Win2008 软件大小: 220KB 图片预览: 软件简介:xTiNt绿色版是一款简单易于使用能够帮助用户进行论坛发帖的软件.本软件主要是主为了编程员在论坛上发帖而诞生,支持以html或ubb代码将程序源代码语法高亮显示.使源代码更加吸引别人,也更易于阅读与分析.目前已经支持vb,delphi,c,汇编四种语言.如果你发帖时

apache 绿色版 安装

下载绿色版apache 本文已apache2.4为例 http://www.apachehaus.com/cgi-bin/download.plx 下载后解压 打开readme_first.html文件 可以看到如果是 xp则需要安装 vs 2008 sp1 和 vc2008  自己下载后更新 安装为服务 httpd.exe -k install 错误提示: Testing httpd.conf.... Errors reported here must be corrected before

mysql绿色版安装及授权连接

--安装包官网下载地址:https://dev.mysql.com/downloads/mysql/5.7.html#downloads --安装教程参见:https://www.cnblogs.com/rysinal/p/7565259.html --授权连接参见:https://www.cnblogs.com/jesu/p/7405528.html --安装版完整卸载参见:https://www.cnblogs.com/qianzf/p/8302272.html --绿色版安装卸载参见:ht

Win10配置MySQL8.0.15免安装版教程

官网下载免安装版的,然后解压到指定文件夹. 首先配置环境变量: 将 mysql 文件夹下的 bin 文件夹路径添加到系统环境变量即(添加到 path 里) 在mysql-8.0.15-winx64文件夹中创建一个data文件夹 在mysql-8.0.15-winx64文件夹中新建 my.ini 文件,文件内容为: [client] port=3306 [mysql] [mysqld] port=3306 #此处改为你自己的安装路径 basedir= D:\\ruanjian\mysql-8.0.