Download packages
wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-community-server_8.0.33-1debian11_amd64.deb
wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-community-client_8.0.33-1debian11_amd64.deb
wget https://dev.mysql.com/get/Downloads/MySQL-8.0/libmysqlclient-dev_8.0.33-1debian11_amd64.deb
wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-community-server-core_8.0.33-1debian11_amd64.deb
wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-common_8.0.33-1debian11_amd64.deb
wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-community-client-core_8.0.33-1debian11_amd64.deb
wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-community-client-plugins_8.0.33-1debian11_amd64.deb
wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-client_8.0.33-1debian11_amd64.deb
Install packages in the following order
apt install ./mysql-common_8.0.33-1debian11_amd64.deb
apt install ./mysql-community-client-plugins_8.0.33-1debian11_amd64.deb
apt install ./mysql-community-client-core_8.0.33-1debian11_amd64.deb
apt install ./mysql-community-client_8.0.33-1debian11_amd64.deb
apt install ./mysql-community-server-core_8.0.33-1debian11_amd64.deb
apt install ./mysql-client_8.0.33-1debian11_amd64.deb
apt install ./mysql-community-server_8.0.33-1debian11_amd64.deb
incase, during installation, it did not ask for settings up the root password, you can reset the root password by following steps
start mysql in safe mode
systemct stop mysql
sudo mysqld_safe --skip-grant-tables --skip-networking &
mysql -u root -p
mysql> update user set authentication_string=NULL where User='root';
mysql> exit
kill -9 mysqld
now start mysql in normal mode
systemctl start mysql
mysql -u root -p
Enter password: [ENTER]
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'MyR00tPass';
mysql> flush privileges;
mysql> exit
optional step
systemctl restart mysqld
try connecting mysql with new root password
mysql -u root -p
Enter password: [PASSWORD]
mysql>
for CentOS, you can follow this link and for MySQL5.7 you can follow this link
Enjoy ;)
No comments:
Post a Comment