Change and Reset MySQL root Password Cambio y MySQL Restablecer contraseña de root
Other then the ways specified Entonces los otros medios especificados here aquí 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 reiniciar y cambiar la contraseña de root para la base de datos MySQL en el caso de que la contraseña se olvida o se pierde, las siguientes instrucciones explican detalladamente la forma alternativa en la última parte de la guía, que no necesita de ficheros adicionales que se crearán:
- Login as root to the Windows or Unix-like (Unix, Linux or BSD) machine with the MySQL server. Accediendo al sistema como root para el Windows o Unix (Unix, Linux o BSD) con la máquina servidor MySQL.
- Stop the MySQL server by using either of the following command: Pare el servidor MySQL usando cualquiera de los siguientes 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 parada - Open the mysql server startup script (ie mysql-server.sh - the file executed to start or stop MySQL server. Abra el servidor mysql script de arranque (es decir, mysql-server.sh - ejecutado el archivo para iniciar o detener servidor MySQL.
- Add –skip-grant-tables to the end of the line that contains the mysqld_safe command as its parameter. Add-skip-grant-tables a la final de la línea que contiene la mysqld_safe su comando como parámetro.
- Start MySQL server with the following command: Iniciar servidor de MySQL con el siguiente comando:
Linux: /etc/rc.d/init.d/mysql start Linux: / etc / rc.d / init.d / mysql inicio
FreeBSD: /usr/local/etc/rc.d/mysql-server.sh start FreeBSD: / usr / local / etc / rc.d / mysql-server.sh inicio - Alternatively, start the MySQL server directly and skip the editing with the following command: Por otro lado, iniciar el servidor MySQL y pase directamente a la edición con el siguiente comando:
mysqld_safe –skip-grant-tables & mysqld_safe-skip-grant-tables &
Depending on your path environment, you may need to point to the correct directory where mysqld_safe is instead. Dependiendo de su camino medio ambiente, es posible que tenga que apuntan a corregir el directorio donde se mysqld_safe lugar.
- Run the following commands to login as the mysql user and connect to mysql user/permission database: Ejecute los siguientes comandos para iniciar la sesión como usuario mysql y conectarse a mysql usuario / permiso base de datos:
# mysql -u root mysql # Mysql-u root mysql
- Run the update queries to change the MySQL password: Ejecutar las consultas de actualización para cambiar la contraseña de MySQL:
mysql> UPDATE user SET Password=PASSWORD(’newrootpassword’) WHERE User=’root’; mysql> UPDATE usuarios SET Password = PASSWORD ( 'newrootpassword') WHERE User = 'root';
mysql> FLUSH PRIVILEGES; mysql> FLUSH PRIVILEGES;Note: Replace newrootpassword with the new root password for MySQL server. Nota: Reemplace newrootpassword con la nueva contraseña de root para el servidor MySQL. Flush Privileges is needed to making the password change effect immediately. Enjuague los privilegios que se necesita para hacer el cambio de contraseña efecto inmediato.
- Exit mysql database client by typing exit. Salir de base de datos mysql cliente escribiendo salida.
- Stop MySQL server with commands listed at step 2. Detener servidor MySQL con los comandos enumerados en el paso 2.
- Open the mysql server startup script edit in step 3 again and remove the –skip-grant-tables parameter that has been added. Abra el servidor mysql editar script de arranque en el paso 3 de nuevo y eliminar el-skip-grant-tables parámetro que se ha añadido.
- Start MySQL server by using command from step 5 or 6. Inicio servidor MySQL usando el mando desde el paso 5 ó 6.
For Redhat Linux users, use the following instructions as the root user of Redhat Linux machine: Para los usuarios de Linux Redhat, utiliza las siguientes instrucciones como el usuario root de la máquina Red Hat Linux:
- Stop MySQL process by using command: Detener MySQL proceso mediante el uso de comando:
# killall mysqld # Killall mysqld
- Start the MySQL server with following options: Inicie el servidor MySQL con las siguientes opciones:
# /usr/libexec/mysqld -Sg –user=root & # / Usr / libexec / mysqld-SG-user = root &
- Start the MySQL client: Inicie el cliente de MySQL:
# mysql # MySQL
You should see the following message: Debería ver el siguiente mensaje:
Welcome to the MySQL monitor. Bienvenido al MySQL monitor. Commands end with ; or g. Comandos de terminar con, o g.
Your MySQL connection id is 1 to server version: 3.xx.xx Su identificador de conexión MySQL es de 1 a versión del servidor: 3.xx.xxType ‘help;’ or ‘h’ for help. Tipo de ayuda; 'o' h 'para obtener ayuda. Type ‘c’ to clear the buffer. Tipo 'c' para borrar el buffer.
mysql>
- Use mysql database: Utiliza base de datos MySQL:
mysql> USE mysql mysql> USE mysql
You should see the following message: Debería ver el siguiente mensaje:
Reading table information for completion of table and column names Lectura mesa de información para la realización de mesa y nombres de columna
You can turn off this feature to get a quicker startup with -A Puede desactivar esta función para obtener una rápida puesta en marcha con-ADatabase changed Base de Datos cambiado
- Then, update the password for the root user with the following command: A continuación, actualizar la contraseña para el usuario root con el siguiente comando:
UPDATE user SET password=password(”newpassword”) WHERE user=”root”; UPDATE usuarios SET password = password ( "newpassword") en caso de user = "root";
Replace newpassword with your desired password. Sustituir newpassword con su contraseña deseada. You should see the following message: Debería ver el siguiente mensaje:
Query OK, 2 rows affected (0.03 sec) Query OK, 2 filas afectadas (0,03 segundos)
Rows matched: 2 Changed: 2 Warnings: 0 Filas combinado: 2 cambiado: 2 Advertencias: 0Rows affected may be different, but the Query OK should be there. Filas afectadas pueden ser diferentes, pero el Query OK debería estar allí.
- Flush the database privileges to reload it in order to make the changes effective: Enjuague la base de datos de privilegios para volver a cargar con el fin de hacer efectivos los cambios:
mysql> flush privileges; mysql> FLUSH PRIVILEGES;
You should get the following result: Usted debe obtener los siguientes resultados:
Query OK, 0 rows affected (0.02 sec) Query OK, 0 filas afectadas (0,02 segundos)
- Exit the MySQL client by typing exit. Salga del cliente de MySQL escribiendo salida.
- Kill the MySQL server process by typing killall mysqld. Matar el servidor MySQL proceso de tipificación killall mysqld.
- Then start MySQL again: A continuación, empezar de nuevo de MySQL:
/etc/init.d/mysqld start / etc / init.d / mysqld comienzo
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. IMPORTANTE: Se trata de una máquina que traduzca la página se proporciona "tal cual" sin garantía. Machine translation may be difficult to understand. La traducción automática puede resultar difícil de entender. Please refer to Por favor, consulte original English article artículo original Inglés whenever possible. siempre que sea posible.
Share and contribute or get technical support and help at Compartir y contribuir o recibir apoyo técnico y ayudar a My Digital Life Forums Mi vida digital Foros .
Related Articles Artículos relacionados
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 3 Instalación de Web Server en FreeBSD 6,0 con Apache 2,2, 5,0 MySQL y PHP 5 - Parte 3
- Reset the Root Password of MySQL Server Restablecer la contraseña de root del servidor MySQL
- Install Web Server in Windows XP with Apache2, PHP5 and MySQL4 - Part 4 Instalar Web Server en Windows XP con Apache 2, PHP5 y MySQL4 - Parte 4
- Check and Optimize MySQL Database Automatically with Crontab/Cron Comprobar y optimizar automáticamente la base de datos MySQL con crontab / cron
- How to Recover and Reset Gmail (Google Account) Password Cómo recuperar y Reset Gmail (cuenta de Google) Contraseña
- How to Reset AdSense Password Not Associated with Google Account Cómo reiniciar la contraseña de AdSense no asociados a cuenta de Google
- How to Reset WordPress Password to Recover Forgotten Secret Cómo reiniciar WordPress para recuperar la contraseña secreta olvidado
- Change Oracle Database User Password Cambio de bases de datos Oracle contraseña de usuario
- Apple iPhone Root Password and Mobile User Password Apple iPhone contraseña de root y la contraseña del usuario móvil
- Fix for Munin MySQL Monitoring Plugin Graph Not Showing or Blank Fix para Munin MySQL vigilancia plugin gráfico que muestra o no en blanco






June 6th, 2006 18:18 6 de Junio del 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): [...] [...] Por otra parte, en cualquier plataforma, el cliente mysql puede ser usado para fijar la nueva contraseña, aunque es menos segura de restablecimiento de la contraseña (instrucciones detalladas, haga click aquí): [...]
July 9th, 2006 12:05 9 de Julio, 2006 12:05
I wanna reset my ZXDSL 831 ADSL Modemn Quiero restablecer mi ZXDSL 831 ADSL Modemn
Plz tell me the way how to reset it Plz me dicen la forma en cómo restaurarla
I need to do that right now Tengo que hacer eso ahora mismo
Best Rgds Best Rgds
dugger(vincitore) Dugger (vincitore)
December 19th, 2006 14:54 19 de Diciembre de 2006 14:54
[...] Re: Help me retrieve my password Try this link… Change and Reset MySQL root Password [...] Re: Ayúdenme a recuperar mi contraseña Pruebe este enlace… Cambio y MySQL Restablecer contraseña de root
April 23rd, 2007 08:23 23 de Abril, 2007 08:23
[...] Change and Reset MySQL root Password » My Digital Life (tags: mysql administration) No Tags Gelesen: 2 / heute: 2 [...] [...] El cambio y MySQL Restablecer contraseña de root »Mi Vida Digital (tags: mysql administración) no Gelesen etiquetas: 2 / heute: 2 [...]
May 5th, 2008 16:52 Mayo 5, 2008 16:52
[...] judulnya), setelah googling cuma dapat cara untuk mereset dan mengganti password MySQL di UNIX-like di sini. [...] Judulnya), setelah Google Cuma dapat cara untuk mereset dan mengganti contraseña 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 Julio, 2008 05:46
On ubuntu, command is mysqld_safe –-skip-grant-tables & En ubuntu, el mando es mysqld_safe - skip-grant-tables &
Extra dash is required so mysql can parse it correctly. Extra guión es necesaria para que mysql puede analizar correctamente.