欢迎访问悦橙教程(wld5.com),关注java教程。悦橙教程  java问答|  每日更新
页面导航 : > > 文章正文

centos7 安装 mysql5.7 版本(全),centos7安装mysql8

来源: javaer 分享于  点击 7027 次 点评:98

centos7 安装 mysql5.7 版本(全),centos7安装mysql8


centos 安装

版本说明 :centos7,mysql5.7 ,不是 centos7 可能有些命令不兼容

修改 mysql 密码

如果已经登录了 mysql ,则可以直接修改密码

# 方法一. 设置当前登录用户密码
mysql> set password=password('newpassword');
# 方法二. 直接改用户表
mysql> use mysql;
mysql> update user set authentication_string=password('123abc') where user='root';
# 方法三. 修改密码
mysql> alter user root@'localhost' identified by '123456';

如果没有登录 mysql ,可以跳过权限检查来修改密码

vi /etc/my.cnf
[mysqld]
skip-grant-tables

# 然后重启 mysql,不需要 root 密码登录 mysql ,之后随便你怎么玩 

windows 安装

一般来说下一步下一步就完事了,但我那时候下载的可能是个测试版本,有个 1045 错误,估计现在的版本都没有了吧。解决办法其实就是跳过权限检查,重置密码,这里给新手一个操作的方法

1. 先停止 mysql 服务,然后 cmd 到 mysql 的 bin 目录
2. mysqld -nt --skip-grant-tables
3. 启动 mysql 执行 mysqladmin -u root flush-privileges password <password>

一点小推广

创作不易,希望可以支持下我的开源软件,及我的小工具,欢迎来 gitee 点星,fork ,提 bug 。

Excel 通用导入导出,支持 Excel 公式
博客地址:https://blog.csdn.net/sanri1993/article/details/100601578
gitee:https://gitee.com/sanri/sanri-excel-poi

使用模板代码 ,从数据库生成代码 ,及一些项目中经常可以用到的小工具
博客地址:https://blog.csdn.net/sanri1993/article/details/98664034
gitee:https://gitee.com/sanri/sanri-tools-maven

相关文章

    暂无相关文章
相关栏目:

用户点评