Change and Reset MySQL root Password Mudança e Reset MySQL raiz Senha
Other then the ways specified Outras formas especificadas em seguida a here aqui to reset and change the root password for mySQL database in the case that the password is forgotten or lost, the following instructions explain in details the alternative way at the last part of the guide, where no additional file needs to be created: para redefinir e alterar a senha do root para banco de dados mySQL, no caso de que a senha é esquecido ou perdido, as seguintes instruções explicar em detalhes a forma alternativa ao nível da última parte do guia, onde nenhum arquivo adicional tem de ser criado:
- Login as root to the Windows or Unix-like (Unix, Linux or BSD) machine with the MySQL server. Login como raiz para o Windows ou Unix-like (Unix, Linux ou BSD) máquina com o servidor MySQL.
- Stop the MySQL server by using either of the following command: Pare o servidor MySQL, usando um dos seguintes comandos:
Linux: /etc/rc.d/init.d/mysql stop Linux: / etc / rc.d / init.d / mysql stop
FreeBSD: /usr/local/etc/rc.d/mysql-server.sh stop FreeBSD: / usr / local / etc / rc.d / mysql-server.sh parar - Open the mysql server startup script (ie mysql-server.sh - the file executed to start or stop MySQL server. Abra o servidor MySQL scripts (ou seja, mysql-server.sh - executa o arquivo para iniciar ou parar o MySQL server.
- Add –skip-grant-tables to the end of the line that contains the mysqld_safe command as its parameter. Adicione-skip-concessão de quadros para o final da linha que contém o comando mysqld_safe como seu parâmetro.
- Start MySQL server with the following command: Inicie o servidor MySQL com o seguinte comando:
Linux: /etc/rc.d/init.d/mysql start Linux: / etc / rc.d / init.d / mysql start
FreeBSD: /usr/local/etc/rc.d/mysql-server.sh start FreeBSD: / usr / local / etc / rc.d / mysql-server.sh início - Alternatively, start the MySQL server directly and skip the editing with the following command: Como alternativa, inicie o servidor MySQL e saltar diretamente a edição com o seguinte comando:
mysqld_safe –skip-grant-tables & mysqld_safe-skip-conceder-quadros &
Depending on your path environment, you may need to point to the correct directory where mysqld_safe is instead. Dependendo do seu caminho ambiente, pode ser necessário para apontar para o diretório onde mysqld_safe é correto vez.
- Run the following commands to login as the mysql user and connect to mysql user/permission database: Execute os seguintes comandos para login como o usuário mysql e conectar ao usuário mysql / permissão base de dados:
# mysql -u root mysql # Mysql-u root mysql
- Run the update queries to change the MySQL password: Executar a atualização de consulta para alterar o MySQL senha:
mysql> UPDATE user SET Password=PASSWORD(’newrootpassword’) WHERE User=’root’; mysql> UPDATE user SET Password = PASSWORD ( 'newrootpassword') WHERE User = 'root';
mysql> FLUSH PRIVILEGES; mysql> FLUSH PRIVILEGES;Note: Replace newrootpassword with the new root password for MySQL server. Observação: Substitua newrootpassword com a nova senha para o servidor MySQL raiz. Flush Privileges is needed to making the password change effect immediately. Flush Privilégios é necessária para tornar a senha alterar efeito imediato.
- Exit mysql database client by typing exit. Exit mysql database cliente digitando a sair.
- Stop MySQL server with commands listed at step 2. Parar servidor MySQL com comandos listados na etapa 2.
- Open the mysql server startup script edit in step 3 again and remove the –skip-grant-tables parameter that has been added. Abra o servidor MySQL scripts editar no passo 3 novamente e remova-o pular de concessão de quadros parâmetro que foi adicionado.
- Start MySQL server by using command from step 5 or 6. Inicie o servidor MySQL usando comando do passo 5 ou 6.
For Redhat Linux users, use the following instructions as the root user of Redhat Linux machine: Red Hat Linux para os usuários, use as seguintes instruções como a raiz do usuário Linux RedHat máquina:
- Stop MySQL process by using command: Parar processo usando o MySQL comando:
# killall mysqld # Killall mysqld
- Start the MySQL server with following options: Inicie o servidor MySQL com os seguintes opções:
# /usr/libexec/mysqld -Sg –user=root & # / Usr / libexec / mysqld-Sg-user = root &
- Start the MySQL client: Inicie o cliente MySQL:
# mysql # MySQL
You should see the following message: Você deverá ver a seguinte mensagem:
Welcome to the MySQL monitor. Bem vindo ao MySQL monitor. Commands end with ; or g. Comandos com efeito, ou g.
Your MySQL connection id is 1 to server version: 3.xx.xx A sua ligação MySQL id é 1 para a versão: 3.xx.xxType ‘help;’ or ‘h’ for help. Digite 'help;' ou 'h' para ajuda. Type ‘c’ to clear the buffer. Tipo "c" para limpar o buffer.
mysql>
- Use mysql database: Use banco de dados MySQL:
mysql> USE mysql mysql> USE mysql
You should see the following message: Você deverá ver a seguinte mensagem:
Reading table information for completion of table and column names Leitura tabela informações para a conclusão de mesa e de coluna nomes
You can turn off this feature to get a quicker startup with -A Você pode desativar esse recurso para obter um rápido arranque com-ADatabase changed Banco de dados alterados
- Then, update the password for the root user with the following command: Em seguida, atualizar a senha para o usuário root com o seguinte comando:
UPDATE user SET password=password(”newpassword”) WHERE user=”root”; UPDATE user SET password = password ( "newpassword") WHERE user = "root";
Replace newpassword with your desired password. Substituir newpassword com sua senha desejada. You should see the following message: Você deverá ver a seguinte mensagem:
Query OK, 2 rows affected (0.03 sec) Query OK, 2 linhas afectadas (0,03 segundos)
Rows matched: 2 Changed: 2 Warnings: 0 Linhas correspondência: 2 Changed: 2 Advertências: 0Rows affected may be different, but the Query OK should be there. As linhas afetadas podem ser diferentes, mas o Query OK deveria estar lá.
- Flush the database privileges to reload it in order to make the changes effective: Lavar o banco de dados privilégios para recarregar-lo, a fim de tornar eficazes as mudanças:
mysql> flush privileges; mysql> flush privilégios;
You should get the following result: Você deve obter o seguinte resultado:
Query OK, 0 rows affected (0.02 sec) Query OK, 0 linhas afectadas (0,02 segundos)
- Exit the MySQL client by typing exit. Saia do MySQL cliente digitando a sair.
- Kill the MySQL server process by typing killall mysqld. Matar o servidor MySQL processo escrevendo killall mysqld.
- Then start MySQL again: Então inicie o MySQL novamente:
/etc/init.d/mysqld start / etc / init.d / mysqld iniciar
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. IMPORTANTE: Esta é uma página traduzida máquina que é fornecida "como está" sem garantia. Machine translation may be difficult to understand. A tradução automática pode ser difícil de compreender. Please refer to Por favor, consulte a original English article Inglês original article whenever possible. sempre que possível.
Share and contribute or get technical support and help at Compartilhe e contribuir ou obter suporte técnico e ajudar a My Digital Life Forums Minha vida digital Fóruns .
Related Articles Artigos relacionados
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 3 Instalando Web Server no FreeBSD 6,0 a 2,2 Apache, MySQL e 5,0 PHP 5 - Parte 3
- Reset the Root Password of MySQL Server Redefinir a senha do root do servidor MySQL
- Install Web Server in Windows XP with Apache2, PHP5 and MySQL4 - Part 4 Instalar Web Server no Windows XP com Apache2, PHP5 e MySQL4 - Parte 4
- Check and Optimize MySQL Database Automatically with Crontab/Cron Verificar e otimizar automaticamente com o banco de dados MySQL crontab / cron
- How to Recover and Reset Gmail (Google Account) Password Como Recuperar e Reset Gmail (Conta do Google) Senha
- How to Reset AdSense Password Not Associated with Google Account Como redefinir a senha do AdSense não associados a conta do Google
- How to Reset WordPress Password to Recover Forgotten Secret Como WordPress para redefinir a senha secreta para recuperar esquecido
- Change Oracle Database User Password Mudar banco de dados Oracle usuário Senha
- Apple iPhone Root Password and Mobile User Password Apple iPhone raiz móveis e senha Usuário Senha
- Fix for Munin MySQL Monitoring Plugin Graph Not Showing or Blank Fix para Munin MySQL acompanhamento plugin gráfico ou em branco não mostrando











June 6th, 2006 18:18 6 de junho de 2006 18:18
[...] Alternatively, on any platform, mysql client can be used to set the new password, althought it’s less secure way of resetting the password (detailed instruction here): [...] [...] Em alternativa, em qualquer plataforma, cliente mysql pode ser utilizado para definir a nova senha, mas ele é menos segura maneira de redefinir a senha (aqui instruções detalhadas): [...]
July 9th, 2006 12:05 9 de julho de 2006 12:05
I wanna reset my ZXDSL 831 ADSL Modemn Eu quero o meu reset ZXDSL 831 ADSL Modemn
Plz tell me the way how to reset it Plz diga-me o caminho para redefinir a forma como ele
I need to do that right now Eu preciso fazer isso agora
Best Rgds Best Rgds
dugger(vincitore) dugger (vincitore)
December 19th, 2006 14:54 19 de dezembro de 2006 14:54
[...] Re: Help me retrieve my password Try this link… Change and Reset MySQL root Password [...] Re: Ajude-me a recuperar minha senha Experimente este link… Mudança e Reset MySQL raiz Senha
April 23rd, 2007 08:23 23 de abril de 2007 08:23
[...] Change and Reset MySQL root Password » My Digital Life (tags: mysql administration) No Tags Gelesen: 2 / heute: 2 [...] [...] Mudança e Reset Password MySQL raiz "Minha Vida Digital (tags: mysql administração) n º Tags Gelesen: 2 / heute: 2 [...]
May 5th, 2008 16:52 5 de maio de 2008 16:52
[...] judulnya), setelah googling cuma dapat cara untuk mereset dan mengganti password MySQL di UNIX-like di sini. [...] Judulnya), setelah googling Cuma dapat cara untuk mereset dan mengganti senha MySQL di UNIX-like di sini. Wah, perlu sedikit modifikasi ni … Berikut cara2 yang saya lakukan: 1. Wah, perlu sedikit modifikasi ni… Berikut cara2 yang saya lakukan: 1. Kill proses MySQL [...] Kill proses MySQL [...]
July 3rd, 2008 05:46 3 de julho de 2008 05:46
On ubuntu, command is mysqld_safe –-skip-grant-tables & Em Ubuntu, comando é mysqld_safe - skip-conceder-quadros &
Extra dash is required so mysql can parse it correctly. Pitada extra é necessária de modo mysql pode analisar-la corretamente.