Solved .mysql_secret not found for mysql56

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?
 
IMHO it is better to use mariadb nowadays (mysql fork).
 
Last edited by a moderator:
Code:
# mysqladmin -u root password PASSWORD
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
 
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.
 
Code:
# mysqladmin -u root password 'test'
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
 
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.
 
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.
 
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.
 
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.
 
Back
Top