08
out

Mysql – Reset de Senha

 

logomysql

Pessoal blz? Agora vou postar uma dica muito boa sobre como resetar a senha do Mysql

Tutorial reset de Senha Mysql.

Esse tutorial foi feito utilizando o Sistema Operacional Linux Fedora Core 6 (Zod).

1 – Parar o serviço do Mysql abra um shell e digite:

# /etc/init.d/mysqld stop

2 – Iniciar o banco sem as tabelas de privilégios:

# /usr/bin/mysql – -skip-grant-tables

Ex:

[root@ibm ~]# /usr/bin/mysql – -skip-grant-tables &
[1] 6760
[root@ibm ~]# 070718 16:25:59  InnoDB: Started; log sequence number 0 43655
070718 16:25:59 [Note] /usr/libexec/mysqld: ready for connections.
Version: ‘5.0.37’  socket: ‘/var/lib/mysql/mysql.sock’  port: 3306  Source distribution



###### Se Acontecer Este Problema Abaixo #######

[root@ibm ~]# /usr/bin/mysqladmin -u root password ‘diogo’
mysqladmin:
You cannot use ‘password’ command as mysqld runs
 with grant tables disabled (was started with – -skip-grant-tables).
Use: "mysqladmin flush-privileges password ‘*’" instead

####### Solução #######

Conecte ao servidor mysqld com:

# /usr/bin/mysql -u root mysql

Dispare os seguintes comandos no cliente mysql:

mysql> UPDATE user SET Password=PASSWORD(‘novasenha’) WHERE User=’root’;
mysql> FLUSH PRIVILEGES;

Ex:

[root@ibm ~]#/usr/bin/mysql -u root mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.0.37 Source distribution

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> UPDATE user SET password=PASSWORD(‘diogo’) WHERE User=’root’;
Query OK, 2 rows affected (0.00 sec)
Rows matched: 2  Changed: 2  Warnings: 0

####### Nesta Parte Atribuir Previleges N0 Mysql #######

Após isto recarregar a tabela de privilégios:

# /usr/bin/mysqladmin -h localhost flush-privileges

Ex:

[root@ibm ~]#/usr/bin/mysql -u root mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.0.37 Source distribution

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

mysql> Aborted

É isso Pessoal espero ter ajudado com esta dica!!! Seja Livre use Linux! No Windows Vista.

Diogo P. Freitas

One Response to “Mysql – Reset de Senha”

  1. 1
    Proxy Says:

    Nice information about proxies. Thanks! Would a proxy also be worth it surfing the internet?

© 2024 Cafe TI – pra perder o sono. | [RSS] Artigos and [RSS] Comentários

Design by Web4 Sudoku - Powered By Wordpress