您的位置:首页 > 运维架构 > Linux

centos7安装mysql5.5.24找不到初始密码?

2020-07-21 04:12 1596 查看

centos7安装mysql时没有初始密码。
可以直接输入 mysql -uroot -p 进入

[root@bgdata01 mysql-libs]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.24 MySQL Community Server (GPL)

Copyright (c) 2000, 2015, 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> set password=password('123456');
Query OK, 0 rows affected (0.00 sec)

修改命令即可

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: