Solution to install two mysql services at the same time under windows10

Solution to install two mysql services at the same time under windows10

  1. Install MySQL8.0.18 version

  2. Install the decompressed version of MySQL8.0.25
    (1) Download the decompressed package
    (2) Configure the my.ini file

    [mysqld]
    port = 3307
    #mysql安装目录
    basedir =D:\HuanJing\Mysql\mysql-8.0.25-winx64
    #mysql数据存放目录
    datadir =D:\HuanJing\Mysql\mysql-8.0.25-winx64\data
    #允许最大连接数
    max_connections = 1024
    #服务端默认使用字符集
    character-set-server = utf8mb4
    #默认存储引擎
    default-storage-engine = INNODB
    #服务唯一标识
    server_id = 1
    #是否启用慢查询
    slow_query_log = 1
    #指定慢查询日志文件的路径和名字
    slow_query_log_file = slow.log
    #SQL语句运行时间超过该值才会被记录
    long_query_time = 10
    #开启binlog日志
    log-bin = mysql-bin
    #sql模式
    sql_mode = NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
    #注意这里,mysql8默认密码验证插件改为了caching_sha2_password
    #为了与之前的兼容,这里改回mysql_native_password
    default_authentication_plugin = mysql_native_password
    
    [mysql]
    default-character-set = utf8mb4
    
    [client]
    port = 3306
    default-character-set = utf8mb4
    

    (3) Open the dos command window as an administrator and switch to the bin directory of MySQL
    (4) Install the mysql8 service and initialize data
    Insert image description here
    Note: Use the command mysqld --initialize-insecureand the password is empty
    (5) Check whether the installation is successful

  3. Modify the registry.
    After the installation is successful, if direct startup is unsuccessful, check the .err log. It will point to the address of the first step of installation, so you need to modify the registry (1)
    Find the corresponding location 计算机\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\mysql
    Insert image description here
    (2) Modify ImagePaththe path
    and change the first half Just set the current mysql installation directory
    Insert image description here

  4. start upMySQL

net start mysql

Guess you like

Origin blog.csdn.net/weixin_44021888/article/details/132804889