@yaslonane

Как сделать что бы в mysql заходить под учетками системы?

Хочу что бы можно было входить в mysql под учетной записью системы. Что бы именно уз подтягивало, а не просто такое же имя пользователя.
  • Вопрос задан
  • 390 просмотров
Пригласить эксперта
Ответы на вопрос 2
alekciy
@alekciy
Вёбных дел мастер
В $HOME директории создаем файл .my.cnf (т.е. путь до него ~/.my.cnf) в который пишем название секции [client] и дальше реквизиты для соединения (кроме названия базы данных):
[alex@SUNDUKOV:~$] cat ~/.my.cnf 
[client]
user=root
password=root
host=localhost

Тогда можно соединяться указав только нужную для работы базу:
[alex@SUNDUKOV:~$] mysql test
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 1664475
Server version: 5.6.19-1~dotdeb.1 (Debian)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы