mysql-5.7.22-winx64 mysql 安装笔记

本文详细记录了MySQL 5.7.22 免费版在Windows上的下载、安装、配置过程,包括创建my.ini配置文件,设置环境变量,初始化数据库,并解决服务启动问题。遇到服务无法启动时,可以检查配置文件,尝试重新初始化data文件夹,或使用DirectX修复工具。

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

一、免费版mysql-5.7.22-winx64

下载

到官网去下载选择合适的版本
https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.22-winx64.zip

安装

  1. 解压
  2. 创建data文件夹 // 可忽略
  3. 创建my.ini配置文件
  4. 修改my.ini 例子见附录
  5. 添加环境变量
  6. 管理员cdm 运行 mysqld install
  7. 进入bin文件夹 mysqld –initialize-insecure自动生成无密码的root用户(data需要为空)
  8. 启动 命令 net start mysql
  9. 关闭 命令 net stop mysql
  10. 登陆 mysql -uroot -proot
  11. 删除 sc delete mysql

配置文件参考

my.ini

[client]
port=3306
default-character-set=utf8

[mysqld] 
basedir=D:\db\mysql-5.7.21-winx64
# 设置为MYSQL的数据目录 
[root@lumingdong tool]# rpm -ivh mysql-community-common-*.rpm warning: mysql-community-common-5.7.22-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing... ################################# [100%] package mysql-community-common-5.7.22-1.el7.x86_64 is already installed [root@lumingdong tool]# rpm -ivh mysql-community-libs-*.rpm warning: mysql-community-libs-5.7.22-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing... ################################# [100%] package mysql-community-libs-5.7.22-1.el7.x86_64 is already installed [root@lumingdong tool]# rpm -ivh mysql-community-client-*.rpm warning: mysql-community-client-5.7.22-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing... ################################# [100%] package mysql-community-client-5.7.22-1.el7.x86_64 is already installed [root@lumingdong tool]# rpm -ivh mysql-community-server-*.rpm warning: mysql-community-server-5.7.22-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing... ################################# [100%] file /usr/bin/mysql from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-client-5.7.22-1.el7.x86_64 file /usr/bin/mysqladmin from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-client-5.7.22-1.el7.x86_64 file /usr/bin/mysqldump from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-client-5.7.22-1.el7.x86_64 file /usr/bin/mysqlpump from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-client-5.7.22-1.el7.x86_64 file /etc/my.cnf from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/bin/my_print_defaults from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /var/lib/mysql from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/bin/mysql_install_db from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/bin/mysql_ssl_rsa_setup from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/bin/mysql_tzinfo_to_sql from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/bin/mysql_upgrade from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/adt_null.so from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/auth_socket.so from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/authentication_ldap_sasl_client.so from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/connection_control.so from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/group_replication.so from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/innodb_engine.so from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/keyring_file.so from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/keyring_udf.so from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/libmemcached.so from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/locking_service.so from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/mypluglib.so from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/mysql_no_login.so from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/mysqlx.so from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/rewrite_example.so from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/rewriter.so from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/semisync_master.so from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/semisync_slave.so from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/validate_password.so from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/version_token.so from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/sbin/mysqld from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 package mysql-community-server-5.7.22-1.el7.x86_64 is already installed file /etc/my.cnf conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/bin/my_print_defaults conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/bin/mysql_install_db conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/bin/mysql_ssl_rsa_setup conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/bin/mysql_tzinfo_to_sql conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/bin/mysql_upgrade conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/adt_null.so conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/auth_socket.so conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/authentication_ldap_sasl_client.so conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/connection_control.so conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/group_replication.so conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/innodb_engine.so conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/keyring_file.so conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/keyring_udf.so conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/libmemcached.so conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/locking_service.so conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/mypluglib.so conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/mysql_no_login.so conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/mysqlx.so conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/rewrite_example.so conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/rewriter.so conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/semisync_master.so conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/semisync_slave.so conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/validate_password.so conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/version_token.so conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/sbin/mysqld conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /var/lib/mysql conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 [root@lumingdong tool]# chown -R mysql:mysql /var/log/mysqld.logchown -R mysql:mysql /var/log/mysqld.log chown: cannot access ‘/var/log/mysqld.logchown’: No such file or directory chown: cannot access ‘mysql:mysql’: No such file or directory [root@lumingdong tool]# chmod 755 /var/log/mysqld.log [root@lumingdong tool]# systemctl start mysqld Failed to get D-Bus connection: No such file or directory [root@lumingdong tool]#
最新发布
08-15
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值