zoukankan      html  css  js  c++  java
  • [Ubuntu] Access denied for user ‘debiansysmaint’@'localhost’ (using password: YES)

    I have reinstalled my system to Ubuntu 12.04, after installed mysql, i found that there is an error when start mysql: 

    Access denied for user ‘debian-sys-maint’@'localhost’ (using password: YES) 

    After searching the reason via google, i at last found the reason, here is it:

    That’s because debian has a mysql account for switching on/off and checking mysql status, and mysql password for that user “debian-sys-maint” should be the same stored in /etc/mysql/debian.cnf

    here is the way to resolve it.

    1. check the password in /etc/mysql/debian.cnf

    sudo vim /etc/mysql/debian.cnf

    you will see something like these:

    [client]
    host     = localhost
    user     = debian-sys-maint
    password = your-password-here
    socket   = /var/run/mysqld/mysqld.sock
    [mysql_upgrade]
    host     = localhost
    user     = debian-sys-maint
    password = your-password-here
    socket   = /var/run/mysqld/mysqld.sock
    basedir  = /usr 

    2. login to mysql:

    mysql -u root -p

    3. grant the rights to debian-sys-maint

    mysql> GRANT ALL PRIVILEGES ON *.* TO ‘debian-sys-maint’@'localhost’ IDENTIFIED BY ‘your-password-here’ WITH GRANT OPTION;

    Query OK, 0 rows affected (0.00 sec) 

    Done! 

  • 相关阅读:
    IPC机制key值的各位组成
    ctrl+c,ctrl+d,ctrl+z在linux中意义
    Linux x86_64与i386区别之 —— 内存寻址
    readdir_r()读取目录内容
    memmove和memcpy
    sscanf的应用
    获取CPU频率
    盘点十个超级实用的 JS 特性
    Java 类在 Tomcat 中是如何加载的?
    Java 类在 Tomcat 中是如何加载的?
  • 原文地址:https://www.cnblogs.com/davidhhuan/p/2508692.html
Copyright © 2011-2022 走看看