Aller au contenu

Coment Mettre Des Mots De Passe Au Root De Mysql?

Featured Replies

Posté(e)

Bonjour,

Je l'ai fait en anglais. Désolé j'ai un peu la flemme de le traduire.

After the installation of MySQL:

1/ Set the root password for MySQL

> cd /usr/syno/mysql/bin

> ./mysql -u root -p

This is not the operating system's root user, but the root user for MySQL. Initially there is no password, so press Enter to leave it blank. If everything was installed properly and the mysqld daemon is running, you should get a prompt like this:

mysql >

This is the prompt for the mysql client interface. You should set the password for all root users. To get a list of users and their hosts for the server, execute the following command from the mysql client:

mysql > SELECT User, Host FROM mysql.user;

+------+-----------+

+------+-----------+

| root | 127.0.0.1 |

| | DS207P |

| root | DS207P |

| | localhost |

| root | localhost |

+------+-----------+

5 rows in set (0.00 sec)

The results from my server are shown here. After installing, I have five user and host combinations. Although 127.0.0.1 and localhost translate to the same host, the password should be changed for both along with the one for my domain. To change the root user's password, enter the following at this prompt:

mysql > SET PASSWORD FOR 'root'@'127.0.0.1'=PASSWORD('password');

mysql > SET PASSWORD FOR 'root'@'DS207P'=PASSWORD('password');

mysql > SET PASSWORD FOR 'root'@'localhost'=PASSWORD('password');

Replace the word password in quotes with the password that you want to use for root. After you change all of the root passwords, log out of the mysql client with the command quit and log back in with the new password. Newer editions of MySQL do not have anonymous users.

2/ Modify the path in the file /root/.profile to run command mysql

Ajouter en fin de ligne du PATH '/usr/syno/mysql/bin'

Exemple: PATH="$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/usr/syno/bin:/usr/syno/sbin:/usr/local/bin:/usr/local/sbin:/usr/syno/mysql/bin"

fdm900

Rejoindre la conversation

Vous pouvez publier maintenant et vous inscrire plus tard. Si vous avez un compte, connectez-vous maintenant pour publier avec votre compte.

Invité
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Répondre à ce sujet…

Information importante

Nous avons placé des cookies sur votre appareil pour aider à améliorer ce site. Vous pouvez choisir d’ajuster vos paramètres de cookie, sinon nous supposerons que vous êtes d’accord pour continuer.

Account

Navigation

Rechercher

Rechercher

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.