MySql简单安装与配置

本文档介绍了MySql便携版的安装和配置步骤,包括从官方下载安装版和便携版,解析my.ini配置文件,执行初始化数据库、设置初始密码,以及安装和启动mysqld服务。最后,展示了如何修改并使用新密码登录Mysql。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

MySql简单安装与配置

MySql安装

这里介绍的是便携版安装配置 便携版下载地址
官方提供有安装版, 简单方便 安装版下载地址

官方配置文档

  1. my.ini

  2. # Other default tuning values
    # 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 the server from the command line, execute this in a 
    # command line shell, e.g.
    # mysqld --defaults-file="C:\Program Files\MySQL\MySQL Server X.Y\my.ini"
    #
    # To install the server as a Windows service manually, execute this in a 
    # command line shell, e.g.
    # mysqld --install MySQLXY --defaults-file="C:\Program Files\MySQL\MySQL Server X.Y\my.ini"
    #
    # And then execute this in a command line shell to start the server, e.g.
    # net start MySQLXY
    #
    #
    # Guidelines 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
    # https://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]
    
    # pipe=
    
    # socket=MYSQL
    
    port=3306
    
    [mysql]
    no-beep
    
    # default-character-set=
    
    # SERVER SECTION
    # ----------------------------------------------------------------------
    #
    # The following options will be read by the MySQL Server. Make sure that
    # you have installed the server correctly (see above) so it reads this 
    # file.
    #
    # server_type=3
    [mysqld]
    
    # The next three options are mutually exclusive to SERVER_PORT below.
    # skip-networking
    # enable-named-pipe
    # shared-memory
    
    # shared-memory-base-name=MYSQL
    
    # The Pipe the MySQL Server will use
    # socket=MYSQL
    
    # The TCP/IP Port the MySQL Server will listen on
    port=3306
    
    # Path to installation directory. All paths are usually resolved relative to this.
    # basedir="C:/Program Files/MySQL/MySQL Server 8.0/"
    
    # Path to the database root
    # datadir=C:/ProgramData/MySQL/MySQL Server 8.0/Data
    
    # The default character set that will be used when a new schema or table is
    # created and no character set is defined
    # character-set-server=
    
    # The default authentication plugin to be used when connecting to the server
    default_authentication_plugin=caching_sha2_password
    
    # The default storage engine that will be used when create new tables when
    default-storage-engine=INNODB
    
    # Set the SQL mode to strict
    sql-mode="STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION"
    
    # General and Slow logging.
    log-output=FILE
    
    general-log=0
    
    general_log_file="DESKTOP-KT95ASM.log"
    
    slow-query-log=1
    
    slow_query_log_file="DESKTOP-KT95ASM-slow.log"
    
    long_query_time=10
    
    # Error Logging.
    log-error="DESKTOP-KT95ASM.err"
    
    # ***** Group 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值