惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

腾讯CDC
博客园 - Franky
MyScale Blog
MyScale Blog
L
LangChain Blog
Martin Fowler
Martin Fowler
Recent Announcements
Recent Announcements
Stack Overflow Blog
Stack Overflow Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 司徒正美
量子位
A
About on SuperTechFans
C
Check Point Blog
大猫的无限游戏
大猫的无限游戏
Last Week in AI
Last Week in AI
小众软件
小众软件
Apple Machine Learning Research
Apple Machine Learning Research
I
InfoQ
V
Visual Studio Blog
Vercel News
Vercel News
B
Blog
爱范儿
爱范儿
aimingoo的专栏
aimingoo的专栏
U
Unit 42

博客园 - 范晨鹏

分省svg代码 noi数据分析工具 unreal engine 5 移动到其它主机时的 epic games launcher 识别修复 楼宇对讲自动开门的设计与实现 循*迹小车轨道识别算法 树莓派ssh卡顿之双机互联解决 ntfs 时间戳换算 安装 django 教程 利用 dns 实现 app简易抓包 安装django 框架 tensorflow 学习记记——环境安装 用pillow和 opencv做透明通道的两图混全(blend) centos升级gcc centos 7 中 tomcat 安装 xsocks 64位平台下编译问题小记 openwrt 编译newifi 应用程序 mingw 环境编译 liburl故障一例 szutsid youku.com awstats 日志分析工具linux下的安装和使用
centos中 mysql 5.7安装
范晨鹏 · 2016-11-15 · via 博客园 - 范晨鹏

 以免授权模式启动

编辑 /etc/my.cnf,添加以下内容:

 linux环境中:vi /etc/my.cnf

在[MySQL(和PHP搭配之最佳组合)d]配置段添加如下两行:

user=mysql

skip-grant-tables

保存退出编辑。

重新启动 mysqld.

service mysqld restart

使用 mysql免密码连接,修改密码和密码过期标志;

[root@iZm5ei4m ~]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.16 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, 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> select user();

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.00 sec)

mysql> select user();
+--------+
| user() |
+--------+
| root@  |
+--------+
1 row in set (0.00 sec)

mysql>UPDATE mysql.user SET authentication_string=PASSWORD('wajuejishu@34!'),password_expired='N' where USER='root';
Query OK, 1 rows affected, 0 warning (0.00 sec)
mysql> exit
Bye

正常连接:

[root@iZm5ei4mxt5qb65ldoxpywZ ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.16 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, 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>