第二种方法:
[root@mysql /]# vim /etc/my.cnf //编写MySQL配置文件 ………… //省略部分内容 skip-grant-tables //添加如下内容 [root@mysql /]# systemctl restart mysqld //重启MySQL服务 [root@mysql /]# mysql -u root //不用输入密码 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.6.36 Source distribution Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>掌握上述MYsql管理命令的使用,已经可以满足大多数网络管理员(非专业数据库管理员)的工作需要。
Linux公社的RSS地址:https://www.linuxidc.com/rssFeed.aspx