mysql8.0版本在配置文件my.ini[mysqld]加上skip-grant-tables后无法启动

环境:window 7 mysql-8.0.11

现象:在my.ini中加入skip-grant-tables后无法启动mysql

[mysqld]
skip-grant-tables

输入net start mysql后出现无法启动Mysql
在这里插入图片描述

原因:在my.ini中加入skip-grant-tables在mysql8.0中已失效。Mysql 8.X的方法是在命令行中使用mysqld --console --skip-grant-tables --shared-memory启动服务器然后root就可以免密登录了(需要开2个CMD窗口)。

该窗口使用mysqld --console --skip-grant-tables --shared-memory启动服务器
在这里插入图片描述
该窗口使用mysql -uroot -p回车登录即可
在这里插入图片描述

  • 59
    点赞
  • 86
    收藏
    觉得还不错? 一键收藏
  • 39
    评论
以下是MySQL 8.0.33的默认配置文件my.ini: ``` # For advice on how to change settings please see # https://dev.mysql.com/doc/refman/8.0/en/server-configuration-defaults.html # Default MySQL server instance configuration file. # Remove leading # and set options as you need. # The following options will be passed to all MySQL clients [client] #password = your_password port = 3306 socket = /tmp/mysql.sock # The MySQL server [mysqld] port = 3306 socket = /tmp/mysql.sock basedir=C:/Program Files/MySQL/MySQL Server 8.0/ datadir=C:/ProgramData/MySQL/MySQL Server 8.0/Data default_authentication_plugin = mysql_native_password # Enable the following options for performance and security #sql_mode = NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES #innodb_flush_log_at_trx_commit = 1 #sync_binlog = 1 [mysql] no-beep # Enable features for having responsibility for own actions # SQL-92 standard #safe-updates # ANSI_QUOTES [isamchk] key_buffer = 16M # Memory usage #table_open_cache = 256 #sort_buffer_size = 512K #read_buffer_size = 8200 #read_rnd_buffer_size = 8200 [myisamchk] key_buffer = 16M # Memory usage #table_open_cache = 256 #sort_buffer_size = 512K #read_buffer_size = 8200 #read_rnd_buffer_size = 8200 [mysqlhotcopy] interactive-timeout [mysqldump] quick quote-names max_allowed_packet = 16M [mysql.server] # MySQL Server Instance Manager configuration file. # Remove leading # and set the variables as required. #service_name= #startup_type=Automatic #server_type=DEVELOPMENT #enable_ssl=false #port=3306 #basedir="C:/Program Files/MySQL/MySQL Server 8.0/" #datadir="C:/ProgramData/MySQL/MySQL Server 8.0/Data/" #default_authentication_plugin=mysql_native_password #skip-networking=false #skip-grant-tables=false #networking_ipv4=true #networking_ipv6=false #networking_max_connections=100 ``` 请注意,这仅是默认配置文件,您可以根据需要进行更改。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 39
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值