vk4tec
Posts: 131
Joined: Thu Mar 07, 2013 9:05 am
Location: Brisbane QLD
Contact: Website

MySQL

Fri May 20, 2016 11:59 pm

Hello

I have install MySQL server and client

I can not login with either root ( what is the password ) or pi ( raspberry )

Frustrating

I just want to build some tables and talk to them in perl and cgi

- Andrew -
---------------------------------
Andrew Rich
email: [email protected]
http://www.tech-software.net/ ( hobby website )
http://59.167.159.165/ ( Raspberry Pi ADS-B server ) RTL SDR

vk4tec
Posts: 131
Joined: Thu Mar 07, 2013 9:05 am
Location: Brisbane QLD
Contact: Website

Re: MySQL

Sat May 21, 2016 12:05 am

Found it

[email protected]:/etc/mysql $ sudo more debian.cnf
# Automatically generated for Debian scripts. DO NOT TOUCH!
[client]
host = localhost
user = debian-sys-maint
password = f6ykgOaVh2mAlW8j
socket = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host = localhost
user = debian-sys-maint
password = f6ykgOaVh2mAlW8j
socket = /var/run/mysqld/mysqld.sock
basedir = /usr
[email protected]:/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 47
Server version: 5.5.44-0+deb8u1 (Raspbian)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>
---------------------------------
Andrew Rich
email: [email protected]
http://www.tech-software.net/ ( hobby website )
http://59.167.159.165/ ( Raspberry Pi ADS-B server ) RTL SDR

W. H. Heydt
Posts: 10996
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: MySQL

Sat May 21, 2016 1:09 am

Generally speaking, when you install MySQL, it asks you to supply an administrative account and password.

User avatar
DougieLawson
Posts: 36312
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: MySQL

Sat May 21, 2016 2:07 pm

It's trivial (and 100% insecure) to reset the MySQL root password

Create a file /home/pi/mysql-init

Code: Select all

ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';
sudo mysqld_safe --init-file=/home/pi/mysql-init &

You can then use the mysql -u root -p command line to access your system using that new password.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Return to “General discussion”