https://github.com/jmrashed/learn-mysql
https://github.com/jmrashed/learn-mysql
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/jmrashed/learn-mysql
- Owner: jmrashed
- Created: 2023-01-10T01:21:19.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-10T01:37:10.000Z (over 3 years ago)
- Last Synced: 2026-01-24T17:43:06.080Z (5 months ago)
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MySQL root password change
## In the MySQL command-line client, phpMyAdmin or any MySQL GUI:
### Way 1
```sql UPDATE mysql.user
SET authentication_string=PASSWORD('MyNewPass')
WHERE user='root';
FLUSH PRIVILEGES;
```
### Way 2
```sql
# mysql -u root
mysql> USE mysql;
mysql> UPDATE user SET plugin='mysql_native_password' WHERE User='root';
mysql> set password for 'root'@'localhost' = PASSWORD('mySecretPassword');
mysql> FLUSH PRIVILEGES;
mysql> exit;
# service mysql restart
```sql