How to change the mysql root password

后端 未结 10 1414
误落风尘
误落风尘 2020-11-30 08:56

I have installed MySQL server 5 on redhat linux. I can\'t login as root so I can\'t change the root password.

mysql -u root -p  
Enter password:  

        
10条回答
  •  失恋的感觉
    2020-11-30 09:17

    I removed the MySQL installation and deleted the data files, and then reinstalled it.

    Then I was able to set the root password. Once you set the root password to something. mysqladmin won't let you reset it if you don't know it.

    To reset it, you've got to have ownership over how mysqld is executed, and feed it an init file to change the root password: https://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html

提交回复
热议问题