http://gimg2.baidu.com/image_search/src=http%3A%2F%2Fc-ssl.duitang.com%2Fuploads%2Fitem%2F202005%2F08%2F20200508102713_L8aCB.jpeg&refer=http%3A%2F%2Fc-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1649077062&t=40b7b14053ef546a57de4934b9442cbe",

MySQL-8.0.33-winx64 解压版安装 [Windows]

1、下载安装包

2、安装

  1. 解压 mysql-8.0.33-winx64.zip(至:C:\app\mysql-8.0.33-winx64);

  2. 创建my.ini文件;
    默认解压目录无my.ini文件,需自己创建;
    进入目录C:\app\mysql-8.0.33-winx64,创建my.ini,文件内容如下

    [client]
    port=3306
    
    [mysql]
    default-character-set=utf8                
    
    [mysqld]
    basedir = "C:\app\mysql-8.0.33-winx64"          #更改为自己的安装目录
    datadir = "C:\app\mysql-8.0.33-winx64\data"  	#更改为自己的安装目录/data
    port = 3306
    max_connections=200
    
    character-set-server=utf8
    default-storage-engine=INNODB
    
  3. 初始化MySQL
    管理员身份打开CMD,执行如下命令

    cd C:\app\mysql-8.0.33-winx64\bin
    mysqld --initialize-insecure
    mysqld -install
    

    若提示"The service already exists! The current server installed:xxx",则先删除旧服务后再执行" mysqld -install "

    net stop mysql
    mysqld -remove mysql
    
  4. 启动MySQL

    net start mysql
    
  5. 配置环境变量
    添加变量: MYSQL_HOME = C:\app\mysql-8.0.33-winx64
    修改Path变量,在原Path变量的值前添加:%MYSQL_HOME%\bin;

  6. 登录MySQL

    # 初始化root密码
    mysqladmin -u root password 1234
    # 登录MySQL
    mysql -u root -p
    # 输入 12345678
    show databases;
    
posted @ 2024-04-18 20:13  DeepInThought  阅读(245)  评论(0编辑  收藏  举报