您的位置:首页 > 运维架构 > Linux

linux 修改mysql密码

2016-02-13 00:00 351 查看
初始密码为空,使用空密码登陆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;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: