When you want to change the MySQL password of docker-compose

As the title suggests, this is how to change the setting value when setting the mysql password like this.

docker-compose.yml


  mysql:
    image: mysql:5.7.32
    ports:
      - "3306:3306"
    volumes:
      - mysql_data:/var/lib/mysql
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: root_pass
      MYSQL_DATABASE: db_name
      MYSQL_USER: user1
      MYSQL_PASSWORD: user1_pass

volumes:
  mysql_data:

After changing docker-compose.yml normally, execute the following command to reflect the setting value.

docker-compose down --volumes
docker-compose up -d

If you just go down and up normally, MySQL data with a password set will be used, so it will not work. Therefore, it is necessary to delete the volume as in the above command.

Recommended Posts

When you want to change the MySQL password of docker-compose
[rails] After option useful when you want to change the order of DB columns
When you want to use the method outside
A memo when you want to clear the time part of the calendar
I want to change the log output settings of UtilLoggingJdbcLogger
docker-compose.yml when you want to keep mysql running with docker
When you want to change the wording to be displayed when making a select box from enum
When you want to ZIP download the image data saved locally
If you want to change the Java development environment from Eclipse
I want to change the value of Attribute in Selenium of Ruby
[Rails 5] How to display the password change screen when using devise
[Swift] When you want to know if the number of characters in a String matches a certain number ...
Comparison of version strings (Java implementation) when you want to branch the process between two versions
When you want to check whether the contents of a property can be converted to a specific type
I want to know the JSP of the open portlet when developing Liferay
Summary of means when you want to communicate with HTTP on Android
I want you to use Enum # name () for the Key of SharedPreference
I want to output the day of the week
When you want to bind InputStream in JDBI3
Procedure to change lower_case_table_names = 1 in MySQL 8.0 of CentOS 8.3
[RSpec] When you want to use the instance variable of the controller in the test [assigns is not recommended]
I want to var_dump the contents of the intent
Change the timezone of the https-portal container to JST
[Ruby] When you want to replace multiple characters
If you want to satisfy the test coverage of private methods in JUnit
Defense Techniques When You Have to Fight the Performance of Unfamiliar Applications (Part 2)
If you are using Android Room and want to change the column definition
When the hover of Eclipse is hard to see
Change the database (MySQL) primary key to any column.
I want to know the answer of the rock-paper-scissors app
I want to display the name of the poster of the comment
[Rails] How to change the column name of the table
[Rails] Cancel / change the default password validation of devise
If you want to recreate the instance in cloud9
I want to be aware of the contents of variables!
I want to return the scroll position of UITableView!
For those who want to use MySQL for the database in the environment construction of Rails6 ~.
[java tool] A useful tool when you want to send the ipmsg log of PC-A to the specified PC on a regular basis.
Summary of copy and paste commands used when you want to delete the cache in iOS application development anyway
I want you to put the story that the error was solved when you stabbed the charger in the corner of your head
[Rails] [bootstrap] I want to change the font size responsively
I want to expand the clickable part of the link_to method
Use JLine when you want to handle keystrokes on the console character by character in Java
I want to change the color of the upper control navigation bar (Control menu) in Liferay 7 / DXP
How to change the setting value of Springboot Hikari CP
When you want to explicitly write OR or AND with ransack
How to change the contents of the jar file without decompressing
I want to narrow down the display of docker ps
lombok.config when you want to pass @Qualifier to @RequiredArgsConstructor with lombok
[Ruby] I want to reverse the order of the hash table
Delegate is convenient to use when you want to reuse parts
I want to temporarily disable the swipe gesture of UIPageViewController
I want to pass the startup command to postgres with docker-compose.
When you want to reflect the Master Branch information in the Current Branch you are currently working on
A collection of patterns that you want to be aware of so as not to complicate the code
I want to judge the necessity of testing by comparing the difference of class files when refactoring Java
A memorandum when you want to see the data acquired by Jena & SPARQL for each variable.
How to write when you want to handle "array of C language strings" like argv [] in Ruby-FFI
What to do when you want to know the source position where the method is defined in binding.pry
I can't log in to MySQL from Django when using docker-compose
[Swift] How to dynamically change the height of the toolbar on the keyboard