MySQL Forums
Forum List  »  Install & Repo

Re: No root password prompt during installation
Posted by: Lars Tangvald
Date: June 25, 2019 01:09AM

Hi!

First thing to check: If there are already files in /var/lib/mysql, no change will be made to the database (aside from upgrading system tables), so the existing password should work.

The native packages do not by default display the password dialogue when installing, because using unix socket auth for the root user is more secure.

Our packages do, but they may pick up existing settings stored in the system's internal database.

Another possibility is that your system is configured for noninteractive installations. If you're not getting a dialogue about default authentication this may be the case.

A couple of things to try:
- If unix socket auth is set, you can log in with unix root
- Run "sudo mysql -uroot"
- execute "ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'somepassword'

- If doing a clean install, before running apt-get install, run
- sudo debconf-set-selections <<< "mysql-community-server mysql-community-server/root-pass password somepassword"
- sudo debconf-set-selections <<< "mysql-community-server mysql-community-server/re-root-pass password somepassword"
- sudo apt-get install mysql-server
- You should now be able to log in with "somepassword"

Options: ReplyQuote


Subject
Written By
Posted
Re: No root password prompt during installation
June 25, 2019 01:09AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.