windows搭建apache+mysql+php环境

时间:2021-02-01 20:29:20
  1. mysql安装:
    • 下载解压版mysql,解压到预定文件夹;
    • 添加path系统环境变量; C:\Servers\mysql-5.6.34\bin
    • 更改mysql配置文件;my.ini
    • # For advice on how to change settings please see
      # http:
      //dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
      #
      *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
      # *** default location during install, and will be replaced if you
      # *** upgrade to a newer version of MySQL.

      [client]
      default-character-set=utf8
      [mysqld]
      character_set_server = utf8
      log-bin=mysql-bin

      # 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

      # These are commonly set, remove the # and set as required.
      basedir = C:\Servers\mysql-5.6.34
      datadir = C:\Servers\mysql-5.6.34\data
      # port = .....
      # server_id = .....


      # 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

      sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
      performance_schema_max_table_instances=400
      table_definition_cache=400
      table_open_cache=256

       

    • 以管理员身份运行cmd;
    • 输入mysqld -install  可看到安装服务成功提示; 此时已经可正常启动mysql
    • -uroot -p
    • 新数据库没密码; 可直接登录成功;
  2. apache安装  
    • 安装vc11;
    • 下载apache 解压至要安装的文件夹;
    • 修改配置文件
    • httpd.exe -k install -n apache24 安装服务;(删除服务 sc delete apache24)
    • 配置php
    • ServerRoot "C:/Server/Apache24"

       

  3. 整合mysql
    1. 做相关的配置;
    2. 配置curl
  4. 删除mysql默认空密码用户;