..
Forgetting passwords is not something so uncommon, indeed. It is often possible to remedy this oversight in a simple way (consider, for example, the tools of "password recovery" in most common web application), other times it is rather complicated.
Recently I've had to help a client distracted that he had forgotten the root password for the management of MySQL installed on your server. The problem is that to change the admin password ... you must first log in as administrator!
In fact the latter statement is only true in part because, having access to the root of the server, the MySQL will still control so we can follow alternative routes.
In this article we will see precisely how to re-set the root password of MySQL that we have forgotten; genuine and that you have access to the server with administrative privileges.
Then go to the shell of our server. Once logged in we stop the mysqld process:
/ Etc / rc.d / mysqld stophours we start the process just stopped passing the authentication procedures:
If we are working locally on the server (ie only if we have direct access to the physical machine) is good also block remote access:Once the service is started in this mode we have access to MySQL:mysql-u root mysqlWell, we're in! Now we can re-set our root password:UPDATE user set password = PASSWORD ("nuova_pass") WHERE User = 'root'; FLUSH PRIVILEGES; exit;Very important after setting the new password to make a FLUSH privileges!Now we have to restart the MySQL daemon:
/ Etc / rc.d / mysqld restartOnce rebooted try to access with the new credentials ... if everything went well it should work!
| |
MS Access (Advanced)
Learn how to create and manage databases quickly and easily. Starting from 29 €. |
| |
MySQL (Course)
Management of open-source database. From 39 €. |
| |
SQL and Database (Course)
Create and manage relational databases. From 39 €. |