search

Home  >  Q&A  >  body text

After installing mysql, the user name root is displayed when it is completed. When viewing the version on the terminal, it is not root. How can I solve this problem?

Terminal $ mysql -v

ERROR 1045 (28000): Access denied for user 'zhangrui'@'localhost' (using password: NO)

How to solve this? Please give me more details. My name is Dabai.

滿天的星座滿天的星座2745 days ago724

reply all(2)I'll reply

  • 淡淡烟草味

    淡淡烟草味2017-05-18 10:56:07

    You use mysql -u 数据库登录名 -p 然后输入你的密码,看可以进入数据库吗?我在我的 ubuntu 上使用 mysql -v 显示的和你的一样 电脑使用者@localhost。或者使用 mysql --version 查看版本。如果使用 mysql -V -V 是大写的 V.

    reply
    0
  • 阿神

    阿神2017-05-18 10:56:07

    Login without adding a user will automatically identify your current system user.
    You need mysql -uroot -ppassword to log in. The password uQ>=qkdb was told to you during installation. . This is it

    reply
    0
  • Cancelreply