sexta-feira, 18 de janeiro de 2013

Mudando senha do root do mysql                   

01) Parando o servico.

# /etc/init.d/mysql stop
Stopping MySQL database server: mysqld.


02) Iniciando o servidor mysql.

# mysqld_safe --skip-grant-tables &

[1] 5217
root@debian:~# 110830 15:11:28 mysqld_safe Logging to syslog.
110830 15:11:28 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql


03) Conectando no servidor, irá direto para o prompt do mysql.

# mysql -u root

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.49-3 (Debian)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

No prompt  mysql>, digite as linhas abaixo após o caracter maior ( > ) do prompt:

mysql> use mysql;

mysql> update user set password=PASSWORD("nova_senha_aqui") where User='root';

mysql> flush privileges;
mysql> quit


04) Parando o servidor mysql.

# /etc/init.d/mysql stop

Stopping MySQL database server: mysqld110830 15:16:34 mysqld_safe mysqld from pid file
/var/run/mysqld/mysqld.pid ended
[1]+  Done                    mysqld_safe --skip-grant-tables


05) Iniciando o servidor mysql.

# /etc/init.d/mysql start       = ou =      service mysql restart

Starting MySQL database server: mysqld.
Checking for corrupt, not cleanly closed and upgrade needing tables..



------------------------------------------------------------------------------------------------------------------------
===[ Sharing Knowledge ]===   -  Obrigado - Thank you - Danke - Merci - Grazie - Gracias - arigatou gozaimasu
“We make a living by what we get, but we make a life by what we give.”  - Give and you will receive - just share :)
------------------------------------------------------------------------------------------------------------------------

Nenhum comentário:

Postar um comentário