mysql8的linux安装环境_Linux环境——MySQL安装及配置(8.0版本)

补充默认密码的截图

可以在文件 【/var/log/mysqld.log】 中获取,如图:

[root@localhost116 mysql]# tail -100f /var/log/mysqld.log2019-04-25T04:30:51.315933Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.15) initializing of server in progress as process 25808

2019-04-25T04:30:55.323029Z 5 [Note] [MY-010454] [Server] A temporary password is generated forroot@localhost: fu#0YkCp)uv82019-04-25T04:30:57.526215Z 0 [System] [MY-013170] [Server] /usr/sbin/mysqld (mysqld 8.0.15) initializing of server has completed2019-04-25T04:30:59.986257Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.15) starting as process 26049

2019-04-25T04:31:00.635553Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem isself signed.2019-04-25T04:31:00.667243Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.15' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server -GPL.2019-04-25T04:31:00.765178Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: '/var/run/mysqld/mysqlx.sock' bind-address: '::' port: 33060

这里默认密码就是   fu#0YkCp)uv8

访问:

[root@localhost107 mysql]# mysql -uroot -p

Enter password:

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection idis 10Server version:8.0.15Copyright (c)2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracleis 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>

在【/etc/my.cnf】中修改配置,将default-authentication-plugin=mysql_native_password  去掉前面的#,如下图:

重启mysql服务

[root@localhost107 mysql]# service mysqld restart

停止 mysqld: [确定]

正在启动 mysqld: [确定]

[root@localhost107 mysql]#

其他命令:

show variables like '%auth%'; #查看 default_authentication_plugin 的值

show variables like 'default_password_lifetime'; #查看 default_password_lifetime 的值

show variables like '%pass%'; #查看模糊查询pass 属性的值

select user,host,plugin from mysql.user; #查看user表相关字段

set global validate_password_policy=0; #设置 validate_password_policy 全局值为0,可不遵循密码规则

set global validate_password_length=4; #设置 validate_password_length 密码长度最少位数

flush privileges; #修改生效

特别注意:8.0版本中 validate_password.policy/  validate_password.length 最后一个链接符不是下划线_而是点.不然会报错,如下:

mysql> set global validate_password_policy=0;

ERROR1193 (HY000): Unknown system variable 'validate_password_policy'

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值