• 技术文章 >数据库 >mysql教程

    mysql问题:ERROR 1045 (28000): Access denied for user &a_MySQL

    2016-06-01 13:08:33原创545
    First things first. Log in as root and stop the mysql daemon.

    sudo /etc/init.d/mysql stop


    Now lets start up the mysql daemon and skip the grant tables which store the passwords.

    sudo mysqld_safe --skip-grant-tables&

    (press Ctrl+C now to disown the process and start typing commands again)

    You should see mysqld start up successfully. If not, well you have bigger issues. Now you should be able to connect to mysql without a password.

    sudo mysql --user=root mysql

    update user set Password=PASSWORD('new-password')
    flush privileges
    exit


    Now kill your running mysqld then restart it normally.

    sudo killall mysqld_safe&
    (press Ctrl+C now to disown the process and start typing commands again)
    /etc/init.d/mysql start

    You should be good to go. Try not to forget your password again.
    声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。
    专题推荐:
    上一篇:Mysql免安装版的应用_MySQL 下一篇:mysql---union和左连接的两倒面试题_MySQL
    VIP课程(WEB全栈开发)

    相关文章推荐

    • 【腾讯云】年中优惠,「专享618元」优惠券!• mysql数据库角色的实例详解• 浅析MySQL删除方法:delete、truncate、drop的区别• 图文实例解析MySQL的用户管理• mysql中pid文件丢失怎么办• mysql中什么时候用临时表
    1/1

    PHP中文网