Linux下忘记mysql密码该如何修改mysql密码
2016-02-13 17:55
651 查看
初始密码为空,使用空密码登陆mysql执行下列语句
mysql>use mysql; mysql> UPDATE user SET password=PASSWORD("root") WHERE user='root'; mysql> FLUSH PRIVILEGES; mysql> quit; 修改/opt/lampp/phpmyadmin/config.inc.php
找到如下代码:
$cfg['Servers'][$i]['auth_type'] = 'config'; $cfg['Servers'][$i]['user'] = 'root'; $cfg['Servers'][$i]['password'] = ''; $cfg['Servers'][$i]['extension'] = 'mysql'; $cfg['Servers'][$i]['AllowNoPassword'] = true;
修改为:
$cfg['Servers'][$i]['auth_type'] = 'config'; $cfg['Servers'][$i]['user'] = 'root'; $cfg['Servers'][$i]['password'] = 'root'; $cfg['Servers'][$i]['extension'] = 'mysql'; $cfg['Servers'][$i]['AllowNoPassword'] = true;
以上所述是小编给大家分享的Linux下忘记mysql密码该如何修改mysql密码的相关内容,希望对大家有所帮助。
您可能感兴趣的文章:
相关文章推荐
- MySQL中的integer 数据类型
- Linux socket 初步
- MySQL存储过程
- Linux Kernel 4.0 RC5 发布!
- linux lsof详解
- linux 文件权限
- Linux 执行数学运算
- 10 篇对初学者和专家都有用的 Linux 命令教程
- Linux 与 Windows 对UNICODE 的处理方式
- Ubuntu12.04下QQ完美走起啊!走起啊!有木有啊!
- 解決Linux下Android开发真机调试设备不被识别问题
- 运维入门
- 运维提升
- Linux 自检和 SystemTap
- mysql中int、bigint、smallint 和 tinyint的区别与长度
- mysql load data 导出、导入 csv
- source命令执行SQL脚本文件