数据库mysql: [Warning] Using a password on the command line interface can be insecure. ERROR 1045 (2800
1.在root用户下,停止mysqlservice mysqld stop2.vi /etc/my.cnf在[mysqld]的段中加上一句skip-grant-tables[mysqld]skip-grant-tablesshift+z+z;保存退出3.重新启动mysqlsystemctl start mysqld3.登录修改mysql 的密码[root@python2 had...
1.在root用户下,停止mysql
service mysqld stop
2.vi /etc/my.cnf
在[mysqld]的段中加上一句skip-grant-tables
[mysqld]
skip-grant-tables
shift+z+z;保存退出
3.重新启动mysql
systemctl start mysqld
3.登录修改mysql 的密码
[root@python2 hadoop]# mysql -uroot -p
Enter password:
一直敲回车
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.21 MySQL Community Server (GPL)
看到welcome登录成功
5.FLUSH PRIVILEGES; 执行这条命令刷新
6.授权
mysql> GRANT ALL PRIVILEGES ON . TO ‘myuser’@’%'IDENTIFIED BY ‘mypassword’ WITH GRANT OPTION;
Query OK, 0 rows affected, 1 warning (0.01 sec)
6:修改密码
mysql> ALTER USER ‘root’@‘localhost’ IDENTIFIED BY ‘123456’;
Query OK, 0 rows affected (0.00 sec)
7.退出 quit;
- 到vi /etc/my.cnf 删除skip-grant-tables
7.登录mysql 成功修改密码并登录
————————————————
版权声明:本文为CSDN博主「baiyan_er」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/baiyan_er/article/details/79966217
「智能机器人开发者大赛」官方平台,致力于为开发者和参赛选手提供赛事技术指导、行业标准解读及团队实战案例解析;聚焦智能机器人开发全栈技术闭环,助力开发者攻克技术瓶颈,促进软硬件集成、场景应用及商业化落地的深度研讨。 加入智能机器人开发者社区iRobot Developer,与全球极客并肩突破技术边界,定义机器人开发的未来范式!
更多推荐
所有评论(0)