Solved .mysql_secret not found for mysql56

g3du

New Member


Messages: 4

FreeBSD 10.3. Installing mysql56, but cannot find .mysql_secret in either /root or /home/USERNAME. Have reinstalled without success. Have searched for file using FIND command. Where is this file?
 

Datapanic

Well-Known Member

Reaction score: 233
Messages: 444

I don't think there is one for the databases/mysql56-server port. After you install it the mysql root user has no password so you need to set one up with either mysqladmin -u root password 'pickapassword' or better, run mysql_secure_installation
 
D

Deleted member 48958

Guest


IMHO it is better to use mariadb nowadays (mysql fork).
 
Last edited by a moderator:
OP
G

g3du

New Member


Messages: 4

Code:
# mysqladmin -u root password PASSWORD
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
 

Datapanic

Well-Known Member

Reaction score: 233
Messages: 444

I see where the mis-information is - the port's pkg-message has:

Code:
Initial password for first time use of MySQL is saved in $HOME/.mysql_secret
ie. when you want to use "mysql -u root -p" first you should see password
in /root/.mysql_secret

This just isn't true for this port.
 

Datapanic

Well-Known Member

Reaction score: 233
Messages: 444

Code:
# mysqladmin -u root password PASSWORD
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'

Put the new password in single quotes.
 
OP
G

g3du

New Member


Messages: 4

Code:
# mysqladmin -u root password 'test'
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
 

Datapanic

Well-Known Member

Reaction score: 233
Messages: 444

Looks like the password is already set to something. You can reset it by stopping the mysql server and starting it back up with # mysqld_safe --skip-grant-tables &. Login to mysql as root: mysql -u root, set the new password with the following:
Code:
mysql> use mysql;
mysql> update user set password=PASSWORD("PASSWORD") where user='root';
mysql> flush privileges;
mysql> quit

restart mysqld with service mysql-server restartThat should fix it.
 
OP
G

g3du

New Member


Messages: 4

Looks like the password is already set to something. You can reset it by stopping the mysql server and starting it back up with # mysqld_safe --skip-grant-tables &. Login to mysql as root: mysql -u root, set the new password with the following:
Code:
mysql> use mysql;
mysql> update user set password=PASSWORD("PASSWORD") where user='root';
mysql> flush privileges;
mysql> quit

restart mysqld with service mysql-server restartThat should fix it.


This fixed it. Thank you very much for your help. As you noted earlier, the package documentation for mysql56 tells you that there is a .mysql_secret, but I cannot find it after installing it multiple times. It seems that the password does get set to something, but since there is no .mysql_secret, one can only guess what it is.
 

Datapanic

Well-Known Member

Reaction score: 233
Messages: 444

Glad you got it going! Nothing more frustrating than to have ancillary problems while trying to set things up. I have MySQL 56 installed and handling 16 databases - MediWiki X2, MailScanner X3, Observium, Opensim X8, and more and never have problems. It just runs.
 

StreetDancer

Well-Known Member

Reaction score: 3
Messages: 257

Looks like the password is already set to something. You can reset it by stopping the mysql server and starting it back up with # mysqld_safe --skip-grant-tables &. Login to mysql as root: mysql -u root, set the new password with the following:
Code:
mysql> use mysql;
mysql> update user set password=PASSWORD("PASSWORD") where user='root';
mysql> flush privileges;
mysql> quit

restart mysqld with service mysql-server restartThat should fix it.

Thank you kindly. Your instructions fixed my exact issue when I was reading similiar remedies. This has tested working on FreeBSD 10.4-p3 w/ MySQL 5.6 current on ports.
 
Top