当前位置:网站首页>[MySQL 13] if you change your password for the first time after installing mysql, you can skip MySQL password verification to log in
[MySQL 13] if you change your password for the first time after installing mysql, you can skip MySQL password verification to log in
2022-07-03 07:43:00 【Rusty well began】
1、 Can be in my.cnf Add code skip-grant-tables
vi/etc/my.cnf
stay my.cnf Add code to file skip-grant-tables( namely : Skippable MySQL Login with password authentication )
2、 restart MySQL:
systemctl restart mysqld
3、 Sign in MYSQL
No need to use a password , You can log in directly MySQL
[root@localhost /]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 7
Server version: 8.0.18 MySQL Community Server - GPL
Copyright (c) 2000, 2019, 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.
4、 Change Password
<1> First set the original password to empty
mysql>update user set authentication_string="" where user='root';
<2> Then in my.cnf Delete... From file skip-grant-tables, Then enter again mysql
<3>mysql>ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY ' password ‘;
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> update user set authentication_string="" where user='root';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> exit
Bye
[root@localhost /]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 30
Server version: 8.0.18
Copyright (c) 2000, 2019, 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> use mysql;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'siteweb1!';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
mysql> set global validate_password.policy=0;
Query OK, 0 rows affected (0.00 sec)
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'siteweb1!';
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
5、 Refresh mysql Related system permission table
flush privileges;
6、 Get rid of my.cnf Add code to file skip-grant-tables
Get rid of my.cnf Add code to file skip-grant-tables
7、 restart MySQL
systemctl restart mysqld
边栏推荐
- Es writing fragment process
- Analysis of the problems of the 12th Blue Bridge Cup single chip microcomputer provincial competition
- 技术干货|昇思MindSpore算子并行+异构并行,使能32卡训练2420亿参数模型
- Pat class a 1032 sharing
- Go language foundation ------ 12 ------ JSON
- Segment read
- Go language foundation ----- 15 ----- reflection
- The babbage industrial policy forum
- PAT甲级 1027 Colors in Mars
- 【MySQL 13】安装MySQL后第一次修改密码,可以可跳过MySQL密码验证进行登录
猜你喜欢
技术干货|昇思MindSpore可变序列长度的动态Transformer已发布!
Pat grade a 1027 colors in Mars
项目经验分享:实现一个昇思MindSpore 图层 IR 融合优化 pass
【踩坑系列】mysql 修改root密码失败
技术干货|昇思MindSpore创新模型EPP-MVSNet-高精高效的三维重建
Partage de l'expérience du projet: mise en œuvre d'un pass optimisé pour la fusion IR de la couche mindstore
Go language foundation ----- 16 ----- goroutine, GPM model
Reconnaissance et détection d'images - Notes
【LeetCode】2. Valid Parentheses·有效的括号
技术干货|昇思MindSpore NLP模型迁移之Bert模型—文本匹配任务(二):训练和评估
随机推荐
Vertx metric Prometheus monitoring indicators
Partage de l'expérience du projet: mise en œuvre d'un pass optimisé pour la fusion IR de la couche mindstore
项目经验分享:基于昇思MindSpore,使用DFCNN和CTC损失函数的声学模型实现
Go language foundation ------17 ----- channel creation, read-write, security shutdown, multiplexing select
PAT甲级 1029 Median
Pat class a 1032 sharing
experiment.........
技术干货|昇思MindSpore创新模型EPP-MVSNet-高精高效的三维重建
技术干货|昇思MindSpore算子并行+异构并行,使能32卡训练2420亿参数模型
Go language foundation ----- 16 ----- goroutine, GPM model
Go language foundation ------ 14 ------ gotest
IndexSort
Paper learning -- Study on the similarity of water level time series of Xingzi station in Poyang Lake
[mindspire paper presentation] summary of training skills in AAAI long tail problem
Leetcode 213: looting II
项目经验分享:实现一个昇思MindSpore 图层 IR 融合优化 pass
VMware network mode - bridge, host only, NAT network
Introduction of novel RNA based cancer therapies
Go language foundation ----- 15 ----- reflection
Go language foundation ----- 02 ----- basic data types and operators