MySql 5.7 first setup, change root password and password length / ~#root -i MySql 5.7 first setup, change root password and password length / ~#root -i MySql 5.7 first setup, change root password and password length / ~#root -i MySql 5.7 first setup, change root password and password length / ~#root -i MySql 5.7 first setup, change root password and password length / ~#root -i MySql 5.7 first setup, change root password and password length / ~#root -i MySql 5.7 first setup, change root password and password length / ~#root -i MySql 5.7 first setup, change root password and password length / ~#root -i
  • RU
  • UA
  • EN
  • Create an online store
  • Documentation
  • Blog
    • Unix ОS
    • Php
    • MySQL
    • JavaScript
    • Package Managers
    • Docker
    • Seo
  • Auxiliary services
    • Short Links
    • Exchange views YouTube
  • Sign in
  • Create Account
  • Home
  • MySQL
  • MySql 5.7 first setup, change root password and password length

MySql 5.7 first setup, change root password and password length

After installing mysql-server (v5.7) on Ubuntu 18.04 for the first time, you will need to set up a separate user and password for it. To easily operate mysql on the local machine.

1. mysql installation :

sudo apt-get install mysql-server

2. User setup :

sudo mysql_secure_installation

mysql_sequre

For the local machine, LOW parameters were enough for me. It then asks for a password for the root user . Enter a password that is convenient for you and repeat it. Since we will change it in the future, I entered the root password (for some reason I missed it, despite the LOW validation). All other steps worked for me and I pressed Y to continue.

3. The first login from the console under the superuser :

sudo mysql

Should start up in mysql. Next, we check the users that are:

SELECT user,authentication_string,plugin,host FROM mysql.user;

users mysql We see the presence of the root user , but he does not have a password.

Since I need the root password to have root:root access, I'll have to resort to changing the length of the allowed password.

SET GLOBAL validate_password_length= 4 ;

4 - length of the password allowed by the validator.

If a non-LOW validation level was selected, here is a description of the parameters in more detail .

4. Change password by request :

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';

For the changes to take effect:

FLUSH PRIVILEGES;

With the request described above, we check whether everything has taken effect.

SELECT user,authentication_string,plugin,host FROM mysql.user;

Проверка пароля юзера

The root user data has changed. Exit:

exit

and try to connect to mysql by root:root :

mysql -uroot -proot

проверка root mysql

If allowed, then our work was successful.

Source 1 Source 2

30 March 19
2853
0

Comments

Name
E-mail
Rating
Review

Other articles from the category

06 April 2020

The length of the word in a FULLTEXT search. The size of the ft_min_word_len key.

The number of characters in a word when searching for a FULLTEXT key. The ft_min_word_len parameter.

01 September 2019

Mysql database of tires and disks

Base of automobile tires and disks. The database contains: manufacturer, model, year, modification, PCD, diameter, nut, tire and wheel factory sizes, possible replacement options, tire and wheel tuning. There are no trucks in the database.

20 December 2018

Disabling sql_mode=only_full_group_by in mysql 5.7 ubuntu 18.04

What to do if the error SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'db.books' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=onl...

Categories

  • Unix OS
  • Php
  • MySQL
  • JavaScript
  • Package Managers
  • Docker
  • Seo

Latest comments

Добрый день, Сергей. Я на более новых версиях блют...
root-i
23.02.23
Пробовал на transmart колонке. Ничего из перечисле...
Сергей
20.02.23
HenryMit, может быть
root-i
07.02.23
Неофрейдизм — это… Определение, принципы, представ...
HenryMit
07.02.23

I share information in which I needed help and spent a lot of time figuring it out. If the information helped at least one person, then this site was not created in vain.

Thank you for the continuation of the site:
Contacts

Telegram Viber Mail

Search for articles

  • Sign in
  • Create Account

Powered by chmod -R