Files
mkdocs/docs/MySQL/trucs.md
2021-09-15 11:43:35 +02:00

46 lines
719 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Trucs
### Reset Expired root Password for MySQL 5.7 on Mac OS X
1. Arrêter MySQL (PrefPane)
```bash
$ sudo su
$ sudo mysqld_safe skip-grant-tables
```
2. Dans un autre terminal: (MySQL 5.7)
```bash
sh-3.2# mysql -u root
mysql> UPDATE mysql.user SET authentication_string=PASSWORD('password') WHERE user='root';
mysql> FLUSH PRIVILEGES;
```
ou (MySQL 5.6)
```bash
sh-3.2# mysql -u root
mysql> FLUSH PRIVILEGES;
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';
```
3. Se connecter avec le nouveau password:
```bash
$ mysql -u root -p Enter password:
```
### Fix the 2002 MySQL Socket error (OSX)
```bash
$ sudo mkdir /var/mysql
$ sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock
```