L
L
Lyubimoff2020-07-19 08:45:10
linux
Lyubimoff, 2020-07-19 08:45:10

How to access mariadb?

Installed mariadb without conflicts.

On the status message gives

status maria

[email protected]:/$ systemctl status mariadb
● mariadb.service - MariaDB 10.3.22 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor prese>
Active: active (running) since Sun 2020-07-19 12:33:30 +07; 8min ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Main PID: 16688 (mysqld)
Status: "Taking your SQL requests now..."
Tasks: 31 (limit: 19066)
Memory: 69.6M
CGroup: /system.slice/mariadb.service
└─16688 /usr/sbin/mysqld

июл 19 12:33:34 lyubimoff /etc/mysql/debian-start[16726]: Processing databases
июл 19 12:33:34 lyubimoff /etc/mysql/debian-start[16726]: information_schema
июл 19 12:33:34 lyubimoff /etc/mysql/debian-start[16726]: mysql
июл 19 12:33:34 lyubimoff /etc/mysql/debian-start[16726]: performance_schema
июл 19 12:33:34 lyubimoff /etc/mysql/debian-start[16726]: Phase 6/7: Checking a>
июл 19 12:33:34 lyubimoff /etc/mysql/debian-start[16726]: Processing databases
июл 19 12:33:34 lyubimoff /etc/mysql/debian-start[16726]: information_schema
июл 19 12:33:34 lyubimoff /etc/mysql/debian-start[16726]: performance_schema
июл 19 12:33:34 lyubimoff /etc/mysql/debian-start[16726]: Phase 7/7: Running 'F>
июл 19 12:33:34 lyubimoff /etc/mysql/debian-start[16726]: OK



Next, I want to go to root without a password, I am denied access (during installation, they did not ask me for a password)

OK, I want to change the password.

$sudo mysql_secure_installation
Everywhere I press Y.

Then
mysql -u root -p
I enter the same password, access is denied.

Once again I change the password to one. Still doesn't fit.

Why doesn't the password change in mariadb?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Valdemar Smorman, 2020-07-19
@smorman

The root password must be set

A
Antuan1979, 2020-07-19
@Antuan1979

mariadb -u root

B
Boris Korobkov, 2020-07-19
@BorisKorobkov

1. By default, login is not by password, but on behalf of the user, that is,
sudo mariadb
2. Set a new password and change the type of authorization (to by login\password)

update mysql.user set authentication_string=PASSWORD("bla-bla-bla"), plugin="mysql_native_password" where User='root' and Host='localhost';

3. After changing the password, you need to reboot or
FLUSH PRIVILEGES;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question