Wagon car - how to find out mysql username / password

So, atlas.hashicorp.com there are many pre-installed machines with PHP and MySql. But the problem is that I cannot find MySql credentials. I.e:.

https://atlas.hashicorp.com/webinfopro/boxes/ubuntu-xenial-lamp

I can access PhpMyAdmin, but I cannot login. I tried the entire "normal" username / password combination (root, vagrant, 12345678). But none of them work. What is the point of installing MySql when you do not provide root credentials?!?

I also followed some instructions for the reset root user password:

https://help.ubuntu.com/community/MysqlPasswordReset

But I get a bunch of errors and the process ultimately fails. I am not interested in debugging and solving numerous problems - I just want to quickly use the convenient PHP 7 LAMP environment.

+4
source share
4 answers

TL; DR;

Passwords 123

how to get there:

After I unscrewed VM from this window, I logged in and checked several files from mysql conf, and especially the file /etc/mysql/debian.cnf

[12:41 ]-[vagrant@symfony]-[/etc/mysql]
$ sudo more debian.cnf
# Automatically generated for Debian scripts. DO NOT TOUCH!
[client]
host     = localhost
user     = debian-sys-maint
password = 7WpHbEJmn1MxcfD9
socket   = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host     = localhost
user     = debian-sys-maint
password = 7WpHbEJmn1MxcfD9
socket   = /var/run/mysqld/mysqld.sock
basedir  = /usr

so that I can connect using the user from this file

[12:41 ]-[vagrant@symfony]-[/etc/mysql]
$ mysql -u debian-sys-maint -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 17
....

I checked the user in an already created table

mysql> SELECT User, Host, Password FROM mysql.user;
+------------------+-------------+-------------------------------------------+
| User             | Host        | Password                                  |
+------------------+-------------+-------------------------------------------+
| root             | localhost   | *23AE809DDACAF96AF0FD78ED04B6A265E05AA257 |
| root             | symfony.dev | *23AE809DDACAF96AF0FD78ED04B6A265E05AA257 |
| root             | 127.0.0.1   | *23AE809DDACAF96AF0FD78ED04B6A265E05AA257 |
| root             | ::1         | *23AE809DDACAF96AF0FD78ED04B6A265E05AA257 |
| debian-sys-maint | localhost   | *8275381EF253977AC1CD84B53CAFE742E4288272 |
| phpmyadmin       | localhost   | *23AE809DDACAF96AF0FD78ED04B6A265E05AA257 |
+------------------+-------------+-------------------------------------------+
6 rows in set (0,00 sec)

so that they all contain the same password .. ring the bell, checking

mysql> select password ('123');
+-------------------------------------------+
| password ('123')                          |
+-------------------------------------------+
| *23AE809DDACAF96AF0FD78ED04B6A265E05AA257 |
+-------------------------------------------+
1 row in set (0,00 sec)
+8
source

I believe the default is root: root for most of them.

$ mysql -u root -p Enter password: ...

0

, MySQL root, , enter. ...

Username : root

Password : (no, just press enter)

0
source

Just tried all the passwords mentioned above (root, empty line, 123, etc.), nothing helped. I use this block https://app.vagrantup.com/brownell/boxes/xenial64lemp .

After half an hour of forced work, it turned out that the password for the user root secret

0
source

Source: https://habr.com/ru/post/1652987/


All Articles