Вход на сайт

Просмотр новости

Найдите то, что Вас интересует

MySQL mysql_config_editor & expect

Дата публикации: 21-09-2020 17:36:00

This is just a note to help out anyone that might want to use the mysql_config_editor command in their automation tools. the mysql_config_editor does not take a password argument so automation tools that might have before set your password in the .my.cnf file trying to use mysql_config_editor fails. It is possible and quite simple though with the expect tool.  yum -y install expect  it works for apt-get also. So in this example, I will show a simple bash script version. 1st.. my login path does not work... mysql --login-path=localERROR 1045 (28000): Access denied for userSet this with expect You would execute this via your bash script.  expect
MySQL mysql_config_editor & expect appeared first on MariaDB.org


Основное содержимое страницы с новостью.

This is just a note to help out anyone that might want to use the mysql_config_editor command in their automation tools. 

the mysql_config_editor does not take a password argument so automation tools that might have before set your password in the .my.cnf file trying to use mysql_config_editor fails. 

It is possible and quite simple though with the expect tool. 

 yum -y install expect  

it works for apt-get also. 

So in this example, I will show a simple bash script version. 

1st.. my login path does not work... 

mysql --login-path=local

ERROR 1045 (28000): Access denied for user

Set this with expect 

You would execute this via your bash script.  

expect <<EOD

spawn mysql_config_editor set --login-path=local --host=localhost --user=root --password 

expect "password"

send  -- "<PASSWORD>\r"

interact

EOD

Now it works...

mysql --login-path=local

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 1002

Схожие новости

#Наименование новостиТональностьИнформативностьДата публикации
1Lessons From 20 Years Hacking MySQL (Part 1)013.6320-06-2024
2Access Patterns for MySQL05.6617-04-2022
3MariaDB Honeypot09.3106-03-2025
4MySQL Password Rotation with AWS Secrets Manager and Lambda04.6328-12-2020
5Selecting a character set for MySQL and MariaDB clients07.4729-03-2026
6MariaDB Encryption ( data at rest )05.7125-02-2024
7Grokking the MariaDB test runner (MTR)06.7719-02-2023
8Building MariaDB Server from the sources05.2905-04-2024
9MariaDB/MySQL Environment MyEnv 2.1.0 has been released07.0228-02-2024

Классификация: . Схожих патентов: 0. Схожих новостей: 9. Тональность: 0. Информативность: 7.14. Источник: mariadb.org.