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

前端 未结 9 2387
借酒劲吻你
借酒劲吻你 2020-12-13 13:19

I\'ve tried multiple solutions from StackOverflow but haven\'t had any success. I\'m on Mac OSX (Sierra 10.12.3) trying to create a new database and user. From terminal I

相关标签:
9条回答
  • 2020-12-13 14:02

    Is it possible the root password is not what you think it is? Have you checked the file /root/.mysql_secret for the password? That is the default location for the automated root password that is generated from starting from version 5.7.

    cat /root/.mysql_secret
    
    0 讨论(0)
  • 2020-12-13 14:03

    just use:

    $ sudo mysql
    

    without the "-u root" parameter.

    0 讨论(0)
  • 2020-12-13 14:05

    Try this (on Windows, i don't know how in others), if you have changed password a now don't work.

    1) kill mysql 2) back up /mysql/data folder 3) go to folder /mysql/backup 4) copy files from /mysql/backup/mysql folder to /mysql/data/mysql (rewrite) 5) run mysql

    In my XAMPP on Win7 it works.

    0 讨论(0)
提交回复
热议问题