Hero Image

MySQL 8 password reset

Mysql 8 has different method resetting pw then mysql 5. First is needed to set empty auth string

In Linux:

Stop mysqld

service mysqld stop

Start MySQL with skip grant tables

mysqld --skip-grant-tables --skip-networking --user=mysql &

Set authentication empty string

login

mysql -u root

Set empty auth string so could one time login to mysql without password

UPDATE mysql.user SET authentication_string='' WHERE user='root';

Find out mysqld pid and terminate it.

cat /var/lib/mysql/mysql.sock.lock

or

ps aux |grep mysqld

now

kill TERM pidnumber

Start MySQL in normal mode

service mysqld start

One time without pw login

mysql -u root

Set new password

ALTER USER 'root'@'localhost' IDENTIFIED BY 'password';

passsword must be numbers, strings and symbols and long (upon writing was used 16 chars password). Otherwise mysql policy denies new pw.

In Windows:

Stop mysqld

Use MS services to stop mysqld

Start MySQL with skip grant tables

Change into folder C:\Program Files\MySQL\MySQL Server 8.0\bin And start mysqld

mysqld --skip-grant-tables --skip-networking --shared-memory &

Set authentication empty string

login with cmd

mysql -u root

Set empty auth string so could one time login to mysql without password

UPDATE mysql.user SET authentication_string='' WHERE user='root';

Start MySQL in normal mode

Now terminate mysqld with via task manager and start mysqld normally via services

One time login without pw

mysql -u root

Set new password

ALTER USER 'root'@'localhost' IDENTIFIED BY 'password';

passsword must be numbers, strings and symbols and long (upon writing was used 16 chars password). Otherwise mysql policy denies new pw.

Other Related Posts:

Grafana and Zabbix 3.4 setup on ubuntu

Zabbix Install

Php installation

sudo apt update
sudo apt dist-upgrade
sudo apt install php7.0-xml php7.0-bcmath php7.0-mbstring

Add repository

Setup the repository.

wget http://repo.zabbix.com/zabbix/3.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.4-1+xenial_all.deb
sudo dpkg...

Read more

20th Jan 2019

MariaDB setup on centos 7

Update your system:

sudo yum update

Install and Start MariaDB

sudo yum install mariadb-server

Enable MariaDB to start on boot and then start the service:

sudo systemctl enable mariadb
sudo systemctl start mariadb

MariaDB will bind to localhost (127.0.0.1) by default. For informat...

Read more

20th Jan 2019