CentOS6.8中MySQL忘记密码与字符设置处理
2017-05-17 00:00
537 查看
摘要: http://ericchunli.iteye.com/blog/2364614
1.导入脚本:source /root/store.sql
2.查看数据库:show databases
3.使用数据库:use store
4.查看表:show tables
5.描述表:describe t_order_info
6.清空表:truncate table t_order_info
7.给表加主键:alter table t_order_info add primary key(orderId)
8.设置mysql中的字符集
show variables like "%character%";
#找到mysql的配置文件,在mysqld下面加上
character-set-server=utf8
collation-server=utf8_general_ci
# 在client下面加上
default-character-set=utf8即可设置mysql中的字符集
9.MySQL忘记密码处理方案
# 找到mysql的配置文件直接编辑
vim /etc/my.cnf 【有些变态的刚装好没有这个文件,只有一个my.cnf.bak的文件,复制改个名即可】
# 在 [mysqld] 中加上一行跳过权限限制
skip-grant-tables
# 保存退出 重启mysql服务
service mysqld restart
# 用户登录
mysql -uroot -p (直接点击回车,密码为空)
# 选择数据库
use mysql;
# 进行重置密码修改
update user set authentication_string=password('new password') where user='root';
# 刷新权限
flush privileges;
# 退出mysql
quit;
# 将配置文件my.cnf中的skip-grant-tables删除后重启mysql
service mysqld restart
# 如果出现
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements # 执行两个参数来把mysql默认的密码强度的取消或者当然把密码复杂度提高
set global validate_password_policy=0;
set global validate_password_mixed_case_count=2;
# SET PASSWORD = PASSWORD('root');
Linux重启MySQL方法:
1、使用 service 启动:service mysqld start
2、使用 mysqld 脚本启动:/etc/inint.d/mysqld start
3、使用 safe_mysqld 启动:safe_mysqld&
1.导入脚本:source /root/store.sql
2.查看数据库:show databases
3.使用数据库:use store
4.查看表:show tables
5.描述表:describe t_order_info
6.清空表:truncate table t_order_info
7.给表加主键:alter table t_order_info add primary key(orderId)
8.设置mysql中的字符集
show variables like "%character%";
#找到mysql的配置文件,在mysqld下面加上
character-set-server=utf8
collation-server=utf8_general_ci
# 在client下面加上
default-character-set=utf8即可设置mysql中的字符集
9.MySQL忘记密码处理方案
# 找到mysql的配置文件直接编辑
vim /etc/my.cnf 【有些变态的刚装好没有这个文件,只有一个my.cnf.bak的文件,复制改个名即可】
# 在 [mysqld] 中加上一行跳过权限限制
skip-grant-tables
# 保存退出 重启mysql服务
service mysqld restart
# 用户登录
mysql -uroot -p (直接点击回车,密码为空)
# 选择数据库
use mysql;
# 进行重置密码修改
update user set authentication_string=password('new password') where user='root';
# 刷新权限
flush privileges;
# 退出mysql
quit;
# 将配置文件my.cnf中的skip-grant-tables删除后重启mysql
service mysqld restart
# 如果出现
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements # 执行两个参数来把mysql默认的密码强度的取消或者当然把密码复杂度提高
set global validate_password_policy=0;
set global validate_password_mixed_case_count=2;
# SET PASSWORD = PASSWORD('root');
Linux重启MySQL方法:
1、使用 service 启动:service mysqld start
2、使用 mysqld 脚本启动:/etc/inint.d/mysqld start
3、使用 safe_mysqld 启动:safe_mysqld&
相关文章推荐
- centos6.8平台mysql忘记密码后实现
- centos:mysql更改密码和设置远程登录,更改默认字符
- CentOS下安装mysql时忘记设置root密码致无法登录的解决方法
- MySQL忘记密码处理方法
- 忘记Mysql的root密码,处理方法
- MySQL 忘记密码的处理办法
- MySQL忘记密码处理方法解决办法
- MySQL忘记密码处理方法
- CentOS 5 忘记密码处理方法
- CentOS 5.5 安装Apache+MySQL+PHP(yum直接安装,mysql自动备份,mysql忘记密码的找回方法)
- Mysql忘记root密码情况的处理
- centos 6.1 mysql5.21 字符编码设置 (gbk)
- MySQL忘记密码处理方法解决办法
- 简化mysql –uroot –p登录 linux忘记mysql密码处理方法 解决root没有权限
- 忘记Mysql的密码的处理办法
- MySQL忘记密码处理方法
- Linux下忘记mysql密码处理方法
- linux忘记mysql密码处理方法
- 忘记mysql 5.1 root密码的处理方法
- Centos系统mysql 忘记root用户的密码