How to change default passwords for MySQL?

mex

Joined
Nov 7, 2009
Messages
8
Likes
0
Points
0
#1
Hello!
Passwords are stored in what files by default for MySQL-server database access? How correctly to substitute them on new, not to do much harm to system?
For earlier I thank!
 

ramoncio

Joined
May 12, 2010
Messages
1,663
Likes
0
Points
0
#2
It is not easy to change the default mysql root password, as it is hardcoded in many config files, and if you do something wrong you might break your system. But this is not a security issue as root connections are limited to localhost.

What you can do is to create a new user using your preferred password and even granting permissions to access from your lan or any machine. You can do it either from mysql cli or using a gui like webmin or phpmyadmin.
 

mex

Joined
Nov 7, 2009
Messages
8
Likes
0
Points
0
#3
Thanks for the information! The matter is that I already did it, on fighting system, and I really had problems with operation, but as I needed to return all back (as was by default) I could not. It was necessary to complete that that the beginnings :) well it has turned out, but I cannot recollect as where I am is concrete changed... :( Thought that can help me... I Think that sense to change passwords by default in MySQL is not present.
 

ramoncio

Joined
May 12, 2010
Messages
1,663
Likes
0
Points
0
#4
If you have lost access, by setting the wrong permissions, there was a way to recover it, I had to do it some time ago.
The easiest way, if it works, is starting mysqld with skip-grant-tables option, and then changing the root password. And if that doesn't work, there was another way, using a init file and a command line option like 'mysqld --with-init-file=yourinitfile.txt' or something like that.
You will have to Google it and read a little about mysql permissions, as I don't remember it very well, sorry.

Good luck!
 

Members online

No members online now.

Latest posts

Forum statistics

Threads
30,902
Messages
130,886
Members
17,563
Latest member
dineshr
Top