Вы всегда забывали ваш пароль корня MySQL? Оно одной из тех вещей как раз случается несмотря на многочисленнAp меры предосторожности, котор одно могло принять. В результате, вы locked из вашего сервера базы данных. Вы не можете создать новые базы данных и ы данных с меньшим управлением над положением вашего сервера базы данных. В таких ситуациях умея как возвратить корень достигните к вашему серверу базы данных приходит в сподручное. Настолько здесь будет вы можете сделать для того чтобы переустановить пароль для потребителя корня в MySQL как на Windows, так и на Linux.
Потребители Windows:
Logon к вашему серверу как администратор. Убейте сервера MySQL если он бежит. Для того чтобы сделать это вам нужно Менеджер обслуживаний Windows, поэтому щелкните дальше Начните меню, после этого пойдите к Пульт управления, после этого к Управленческие инструменты, и отборно Обслуживания. Здесь ищите сервер MySQL и остановите его. Если оно не перечислено там и, то MySQL до бежать оно намеревается что MySQL не бежит как обслуживание. В тот случай вам нужно нагрузить менеджера задачи вы достигли использующ ключевую комбинацию Ctrl+Alt+Del. Теперь убейте процесс MySQL.
При остановленный процесс MySQL вам нужно принудить изменение паролей на MySQL использующ комбинацию УТОЧНЕНИЕ и ПРИТОК варианты. Так запустите ваше любимейшее редактор текста и создайте новый архив. Впишите following текст в архив заменяя ть «NewMySQLPassword» с вашим новым паролем:
УТОЧНЕНИЕ mysql.user УСТАНОВЛЕННОЕ Password=PASSWORD (» NewMySQLPassword») ГДЕ User=' корень';
ПОЛНЫЕ ПРИВИЛЕГИРОВАННОСТИ;
Первая линия делает что оно уточняет значение поля «пароля» в таблице mysql.user для потребителя «корня» «NewMySQLPassword». Вторая линия топит старый комплект привилегированностей и make sure ваш новый пароль использован везде. За исключением этого текста как C:\mysql _reset.txt.
Затем, вам нужно начать вашего сервера MySQL пройти этот архив как параметр конфигурации. Запустите стержень путем идти к Начните меню, после этого к Бег, и после этого напечатайте на машинке cmd и удар входит. Теперь впишите following команду:
C:\mysql\bin\mysqld - nt --init-file= C:\mysql _reset.txt
Как только сделан сервер начиная delete архив C:\mysql _reset.txt. Ваш пароль корня MySQL должен быть переустановлен теперь. Теперь повторяйте старт вашего сервера MySQL снова. Идите back to менеджер обслуживаний Windows снова сделать то. Ваш новый пароль корня MySQL должен работать для вас теперь.
Потребители Linux:
Log on to your Linux machine as the root user. The steps involved in resetting the MySQL root password are to stop the MySQL server, restart it without the permissions active so you can log into MySQL as root without a password, set a new password, and then restart it normally. Here’s how you do it. First, stop the MySQL server:
# /etc/init.d/mysql stop
Now start the MySQL server using the --skip-grant-tables option, which will run the server without loading the permissions settings:
# mysqld_safe --skip-grant-tables &
The & option at the end makes the command you have executed run as a background process. Now log on to your MySQL server as root:
# mysql -u root
It should allow you in without prompting for a password. The following steps will set the new password:
mysql> use mysql;
mysql> update user set password=PASSWORD(”NewMySQLPassword”) where User=’root’;
mysql> flush privileges;
mysql> quit
Replace “NewMySQLPassword” with your own password. Here’s what happens here. The first line selects the MySQL configuration tables. The second line updates the value of the field “Password” for the user “root” to “NewMySQLPassword”. The third line flushes the old set of privileges and makes sure your new password is used everywhere. Now, the last step is to restart the server normally and use your new root password to log in:
# /etc/init.d/mysql stop
# /etc/init.d/mysql start
# mysql -u root -pNewMySQLPassword
Congratulations, your new MySQL root password is set and your MySQL server is ready to be used again. Remember to update all your applications to use this password if you are using it anywhere.























{ 4 comments… read them below or add one }
OI como faço para recuperar a senha do root do linux Kurumin
http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html
BTW the syntax above is missing a -
There should be a double minus sign in front of the init. Do that and the commands work fine. Looking at it, its missing elsewhere too - so might be your blog s/w converting double en dash to em dash
C:\mysql\bin\mysqld-nt -–init-file=C:\mysql_reset.txt
Thanks Manfred - you’re right, it did convert the double-dashes into a single dash. It’s all fixed now. Thanks again!
Leave a Comment