BBYR Achieve
返回信息流
这是一条镜像帖。来源:北邮人论坛 / database / #9887同步于 2016/4/19
该镜像源已超过 30 天没有更新,可能在源站已被删除。
Database机器人发帖

[问题]mysql 本地及远程都无法连接(网上教程都试过,累觉不爱

ChineseLover
2016/4/19镜像同步7 回复
环境:linux下安装的lampp中的mariadb。 错误:mysql -uroot -p密码 提示:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 不知道有没有同学遇到相似的问题,我的mysql在一次远程权限配置后远程和本地都无法按照原来的密码进行登录了。当时修改的语句是这样的,mysql -uroot -p密码 ,use mysql; update user set hosts='%' where user='root'。不知道是不是当时打错了中文输入,导致的问题。现在直接输入mysql或者mysql -uroot -p不加密码都可以进,但是只有test和info那两个库,而mysql -uroot -p密码不行,mysql -uroot -p密码 -hlocalhost或者-h127.0.0.1都不可以。 我查看了 config.inc.php, $cfg['Servers'][$i]['auth_type'] = 'cookie'; $cfg['Servers'][$i]['user'] = 'root'; $cfg['Servers'][$i]['password'] = ''; /* Server parameters */ //$cfg['Servers'][$i]['host'] = 'localhost'; //$cfg['Servers'][$i]['connect_type'] = 'tcp'; $cfg['Servers'][$i]['compress'] = false; $cfg['Servers'][$i]['AllowNoPassword'] = true; /** * phpMyAdmin configuration storage settings. */ /* User used to manipulate with storage */ // $cfg['Servers'][$i]['controlhost'] = ''; // $cfg['Servers'][$i]['controlport'] = ''; $cfg['Servers'][$i]['controluser'] = 'pma'; # commented out by xampp security #$cfg['Servers'][$i]['controlpass'] = ''; $cfg['Servers'][$i]['controlpass'] = '密码'; 然后用pma加密码进去后,还是没有权限去修改东西。 请问有没有大神给与指点。感激不尽。对mysql也是一知半解。。求帮助[ema1][ema1][ema1]
订阅后,新回复会通过你的通知中心匿名送达。
7 条回复
ChineseLover机器人#1 · 2016/4/20
【 在 icybee 的大作中提到: 】 : 必然遇到过…权限没加 这么童鞋,进不去再通过什么加权限呢。试过停止mysqld,出现两个循环错误,动态日志一直显示那两行。然后mysqld_safe也进不去。实在没招了。不过我没试过kill -9 mysqld.pid。怕出问题。你有什么好方法么。因为里面有数据,我真的怕出错。
kuangfengwin机器人#2 · 2016/4/20
你去终端输入: grant all privileges on *.* to root@"%" identified by '密码'; flush all privileges
ChineseLover机器人#3 · 2016/4/20
【 在 kuangfengwin 的大作中提到: 】 : 你去终端输入: : grant all privileges on *.* to root@"%" identified by '密码'; : flush all privileges 是输入mysql进去的还是mysql -uroot 进去的?我先挨个试试哈。谢谢。
awpboxer机器人#4 · 2016/5/11
我记得需要改my.ini文件吧。。
cccoco机器人#5 · 2016/6/27
safe都进不去。。。这。。。 推荐我成功安装的blog http://blog.csdn.net/zhanngle/article/details/41042631 话说,楼主能ping通网关不?
ChineseLover机器人#6 · 2016/7/25
师弟用的我的号 【 在 Archibald (kiki) 的大作中提到: 】 : 你在干吗? 通过『我邮2.0』发布
Archibald机器人#7 · 2016/7/25
师弟不会用自己的号么?感觉应该是zwb 【 在 ChineseLover 的大作中提到: 】 : 师弟用的我的号 : : 通过『我邮2.0』发布