Docker Compose Run Sql Script

# Create directories sudo mkdir /var/lib/gitlab. The User and Hive SQL documentation shows how to program Hive; Getting Involved With The Apache Hive Community¶ Apache Hive is an open source project run by volunteers at the Apache Software Foundation. Creating clusters with docker swarm. /scripts/init/reset. script that does everything we need to run our integration tests locally or in CI. The current folder is mounted and set as the working directory. These are some possible scenarios: Load testing launching more than one test at a time. Docker Compose uses a YAML file to define the services and then run them with a single command. Note: It is good to keep in mind that I have locally build my docker containers, so they are not available in Docker-hub. I've been running the sqlserver docker image on my mac since preview. Part 4 introduced you to the container naming conventions and internals of container images, configuration of persistent storage for your SQL Server containers and running multiple SQL Server containers on a single host machine. Tool to define and run multi container Docker applications. sql file in an image? the docker run script with a second compose file if the question " how can I do to execute this sql before creating. The point is that putting commands to docker exec in docker-compose. ecs_task – run, start or stop a task in ecs docker_compose – Manage multi-container Docker applications with Docker Compose; vultr_startup_script. I have fairly simple need, and have been struggling with this many hours now. So I can run: docker-compose build then docker-compose up And docker will start mssql and run the scripts to create my database, schemas with tables, views and pre-populated data. ps1 script as an example) and then run: docker stack deploy --compose-file docker-stack. Oracle's OpenJDK JDK binaries for Windows, macOS, and Linux are available on release-specific pages of jdk. sh creates modularity between the commands that should be run at container start up time and the SQL commands that need to be run. We’ve already laid the foundation — freeing you to create without sweating the small things. This is where Docker Compose comes in - rather than considering individual services (containers) we're now thinking at the level of the docker container networks. d folder contains the startup SQL script used for the mysql images. If you rebuild the Docker image and run Docker compose again, the start script should run Apache and serve the Laravel application: docker-compose down docker-compose build docker-compose up Running a Scheduler. Install Halyard on Docker. Run Docker Compose. Deployments can be made easier, in many different ways, by using Docker and Windows Containers; but how do you set about working with them? As part of his practical series on Windows Containers and Docker, Nicolas shows how to deploy a Container Host to the Microsoft Azure cloud. ps1 script witch is starting the SQL service and I simply launch powershell as CMD to start the service manually. js The app should run as before. Docker for Mac の Preference - Advanced で Memory を 4GB に増やす。 その後、docker-compose up -d をやり直したらうまく動いた。 sql-cli. docker exec -i db mysql -uusers_service -p123 users < setup. Update! The Nerd Dinner project has moved to my book Docker on Windows. I have fairly simple need, and have been struggling with this many hours now. Working with Docker. The volumes is specified in the docker-compose. 개요 guacamole은 소개 페이지에도 잘 나와 있지만 특정 클라이언트 프로그램 없이 웹브라우저로 원격 접속을 가능하게 해주는 웹앱이다. The image is aimed at experienced admins who want to benefit from the Docker environment. Additionally, perform a database migration and execute your SQL scripts on the postgreSQL service start up. Portainer stack utils - Bash script to deploy/update/undeploy Docker stacks in a Portainer instance from a docker-compose yaml file. Amazon Elastic Container Service (Amazon ECS) is the Amazon Web Service you use to run Docker applications on a scalable cluster. First, start with a fresh empty. Based on the docker-compose. The main advantage is that docker-compose keeps track of the container it starts (via labels). You can run the included "follow-essbase-logs. yml,其中定义的每个服务都必须通过 image 指令指定镜像或 build 指令(需要 Dockerfile)来自动构建。 其它大部分指令都跟 docker run 中的类似。. Please suggest, if I should use three different docker compose files or environments can be handled using docker only in package. In this case the four docker build commands along with the subsequent docker run commands will be handled with one docker-compose. Docker is an open-source project that automates the deployment of Linux applications inside software containers. Over 750 enterprise organizations use Docker Enterprise for everything from modernizing applications to microservices and data science. You can configure as many containers as you want, how they should be built and connected, and where data should be stored. NET Boilerplate Projects. d Great! All the files that we need have been set up. You can see in the output that the system database files are being moved. 1 The mad service¶. It also has a pair of helper scripts to help those who aren’t familiar with Docker compose get up and running quickly. In this tutorial, you will learn how to run a Docker-enabled sample application on an Amazon ECS cluster behind a load balancer, test the sample application, and delete your resources to avoid charges. by Kangze Huang Docker: Easy as build, run, done! Docker has been getting a lot of buzz recently, and for good reason. Configure and run microservices locally with Docker and Docker Compose; Utilize volumes to mount your code into a container; Run unit and integration tests inside a Docker container; Test the entire set of services with functional, end-to-end tests; Debug a running Docker container; Enable services running in different containers to talk to one. The commands such as docker run and docker commit are complementary to each other. The tutorial. Notice that I am mapping local port 5433 to Sql Server's TCP port so I can use Sql Server Management Studio on my desktop to talk to the database running inside the container - rad! If you have a local instance of sql server running you'll want to do the same. Net Core using Docker I cam across a strange behavior. yml for development, docker-compose. 개요 guacamole은 소개 페이지에도 잘 나와 있지만 특정 클라이언트 프로그램 없이 웹브라우저로 원격 접속을 가능하게 해주는 웹앱이다. In order to get same results you would need to build a docker. I have written a simple wrapper for docker build and docker run that allows me to build and run my image without having to use the docker command directly. The aforementioned compose files make use of variables declared in a. The main advantage is that docker-compose keeps track of the container it starts (via labels). Finally, for the SQL Server Linux image to run inside a container, the docker daemon requires at least 3250MB of memory. First, we…. yml file puts it all together. Pinal Dave is a SQL Server Performance Tuning Expert and an independent consultant. But I’m sure you’ll agree that this is a rather crude method. d folder contains the startup SQL script used for the mysql images. You now have two containers running. If you’re running this script on a machine that is used for other purposes, you might want to tweak it to your needs. example docker compose for postgresql with db init script - docker-compose. If you followed along in Part 0, you should have a fairly recent image of SQL Server Developer Edition running in a Windows container. docker exec -it nifty_golick bash. yml -f docker-compose-test. This lab walks through the evolution of a simple Node. Both Docker client and Docker server can be run on the same or remote system. sh # located at. You may run laradock with or without docker-sync at any time using with the same. Michael is a Docker Alum who used to work on the Docker and Microsoft technology partnership. Hey @Tyrion, Are you running on local machine or remote? If you mount any volume at your source directory (where script is located) it might override entire directory and thus unable to find your script. Now, we define pipeline under:- spark sql SQL. hk-mysql refers to Docker Compose service defined in the below docker-compose. Interestingly, note the absence of any npm install or mvn install from the instructions. You can use any directory if you use it consistently in all the configs (most importantly, docker-compose. However if you are on Linux, you will need to add it manually. Laerte Junior provides a guide to get started creating SQL Server instances in Docker. Usually I prefer to refer to the docker-compose service by service name, rather then container name which might or might not be the same thing. Example sudo docker run hello-world This command will download the hello-world image, if it. Docker Compose "is a tool for defining and running multi-container Docker applications. yml file used to start the Docker group: docker-compose stop ; Note: docker-compose kill is also available if you need to shut things down more forcefully. Adding a Database for Compose # ADD seed. You can run SQL Server in Docker, running your own database in a container which starts in seconds. As per the documentation on Docker Hub, I mount the. Following are the steps to walk through, Define Docker Compose YAML file for a. Ready to attach a SQL Server database in a Linux Docker container. Each microservice can be further broken down into processes running in separate Docker containers, which can be specified with Dockerfiles and Docker Compose configuration files. These are my notes for running Postgres in a Docker container for use with a local Django or Rails development server running on the host machine (not in Docker). These applications are run using containers. SQL Server running as a container with a microservice-related database. Actually, it came out of an insane amount of work done by free and open source powerhouse Eugen Rochko aka Gargron and a small elite developer community, and many predecessors who are part of the GNU Social Fediverse (kudos to Danyl Strype for compiling. The -p netcorebuild portion simply names our container so that we can easily remove it and ensuring that we don't get multiple containers with random names that we have to clean up later. This script has worked through the docker-compose. (the containers do not keep running). Similarly, the docker-entrypoint-initdb. We can modify our docker/start. Image − This is the name of the image which is used to run the container. 1" instead of "2", docker-compose was able to run, and start creating my containers. Connecting to SQL Server 2017 Linux Docker container from Windows machine. Great, now that we can run the app, we can write a Docker Compose script to mimic the run command, so we do not have to keep remembering the parameters. By default, the Docker dashboard template has a few tiles that aren’t set up properly for a good first run – I had to remove this filter for 3 of the tiles to get a proper display of the “per container” metrics. This will upload the backup, execute the SQL commands and re-create your database. 7 MB PostgreSQL Maestro is the premier Windows GUI admin tool for development and management of PostgreSQL databases. Whether you are a seasoned Docker developer or just getting started, Visual Studio Code makes it easy to author Dockerfile and docker-compose. This script has worked through the docker-compose. They contain open source and free. Now run the app using compose: docker-compose -f. I prefer the latter, as there are some options which are valid for Docker Compose, which are not valid for a stack definition. Reserve a static external IP address in the gcloud command-line tool or through the API. Docker-compose is a tool that is able to run multiple container by issuing `docker-compose up`. In today’s blog, I will explain to you how we can get Docker Volume and Persistent Storage. yml -f devicehive-metrics. yml file containing the following code. Docker Compose. i was able to create a postgres sql instance but copy/add my sql script (which creates this table) to /docker-entrypoint-initdb. It had a fresh update on the Docker site but did not reference SQL 2017 at the time of writing this. I use the volumes in docker-compose. 10) and the virtualization in BIOS is enabled. In our case, we have a full stack application which comprises of MongoDB, ExpressJS, Angular and NodeJS. Additionally, we will have to also write a Docker Compose File which will do the actual work. ymlと同じ場所にhtmlファイルを作成します。以下のコマンドでコンテナを実行します。. The application uses the Flask framework and maintains a hit counter in Redis. Using Compose is basically a three-step process:. To bring up the Selenium Grid infrastructure on-demand. While we could go forward running a similar docker run command as I showed in my web service example, this becomes tedious. sh CMD /bin/bash -c /tmp/init_db. Fast installation Getting SQL Server's docker image is as simple as running a docker image pull. I'm trying to make my dev process easier/maintainable using docker(-compose). If you are interested to see how this works, have a look at their docker-entrypoint. 0 or newer from 2. We can run a Bash shell in our running container. The SQL Server on Windows container image has a startup script that will accept an JSON-formatted environment variable that represents a list of databases including data/log files to attach to the SQL Server instance on container run. To test why my SQL server image is not working, I removed the start. sql file that I would like to load with docker-compose. sqlauthority. 7 MB PostgreSQL Maestro is the premier Windows GUI admin tool for development and management of PostgreSQL databases. Learn about building, deploying and managing your apps on Heroku. While it is possible to create a series of 'docker run' commands to build up the multi-container application, Docker Compose simplifies this process significantly. js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. First, we…. Docker Compose. hk-mysql refers to Docker Compose service defined in the below docker-compose. Previously, we created the docker-compose. In docker-compose a common problem is starting services and daemons in containers that depends on services running on linked containers, in example, your app depends on elasticsearch but it is not ready when the app container is started. These are my notes for running Postgres in a Docker container for use with a local Django or Rails development server running on the host machine (not in Docker). I am NOT an expert nor guru shell programmer. Over 750 enterprise organizations use Docker Enterprise for everything from modernizing applications to microservices and data science. yml is unnecessary when you can either do it in the Dockerfile or in the container's startup script, both of which will also make your container more useful when not being run with Compose. The second difference is that the docker-compose run command does not create any of the ports specified in the service configuration. In eShopOnContainers, there is a container named sql. Prerequisites. yml file to combine several steps into one. Now we are ready to attach the database using the TSQL below. Project structure is like this. docker stop $(docker ps -a -q) docker rm $(docker ps -a -q) docker rmi my-old-docker-image docker volume rm $(docker volume ls -q) Dockerfile. The getElementById() method returns the element that has the ID attribute with the specified value. yml Docker-Compose. Connecting Windows SSMS with Docker SQL Server We now will use our local SQL Server tool called SQL Server Management Studio (SSMS) to connect the SQL Server instance running inside the Docker container inside the Azure VM. Alternatively, Docker Compose can be installed inside a virtualenv, which would be entirely separate from the virtualenv used inside the CKAN container, and would need to be activated before running Docker Compose commands. Running SQL Server 2019 in a Docker Container. By using docker compose we can build multiple containers running SQL with one command. To run docker compose with another file than the default one docker-compose. yml use the -f option: docker-compose -f docker-prod. I show you how to quickly create a Docker PostgreSQL local database instance. sh, which is the ENTRYPOINT in the Dockerfile, which means it runs every time the container starts. Since I run Windows 10 on my developer machine it need to setup SQL Server in a Windows Docker container and I figured out, that there some pitfalls that I came along. After joining a swarm, they are referred to as nodes. If your CPU does not support virtualization, or if you do not have a 64-bit CPU, you cannot run Docker locally. Finally, for the SQL Server Linux image to run inside a container, the docker daemon requires at least 3250MB of memory. But when the container is removed the script will get removed right along with it. I can see that the docker container is running and exposing the debugging port (55223 in this case). Since I run Windows 10 on my developer machine it need to setup SQL Server in a Windows Docker container and I figured out, that there some pitfalls that I came along. cd C:\docker\compose And now we can run our compose command. A pair of Docker containers is used to run the site locally for development. These containers are unique because they bring together all the dependencies of an application into a single package and deploy it. We marked the dependency between these services properly using depends_on in the docker-compose. Docker Windows SQL Server Containers and Database Clones Scripts are run during the parent VHD build, creating an immutable artifact that incorporates user permissions, data masking, and other. We DBAs tend to make a meal out of provisioning SQL Server instances. x) and if you use the phpMyAdmin configuration storage, you should run the SQL script found in sql/upgrade_column_info_4_3_0+. 1' # if no version is specified then v1 is assumed. sql — an SQL script to initialize the database before the first time the app runs We will use docker. Stack Exchange Network. This tutorial is about building HTTP request pipeline on ASP. It just so happens docker provides a tool called “Compose” that is just for that reason. By using docker compose we can build multiple containers running SQL with one command. yml file that runs SQL Server for Linux with all the SQL Server databases needed for the microservices. Database Docker Service. Docker是什么?在计算机技术日新月异的今天,Docker在国内发展的如火如荼,特别是在一线互联网公司,Docker的使用是十分普遍的,甚至成为了一些企业面试的加分项,不信的话看看下面这张图。. yml file describes the individual containers, the. Syntax docker run image Options. docker-guacamole은 3가지 이미지로 구현 되는데, 먼저 demon이 있고 tomcat위에. When you run docker-compose up to update the containers, Compose removes the old container and inserts a new one. Preparation: Create folders and download scripts. Connecting to SQL Server 2017 Linux Docker container from Windows machine. Michael is a Docker Alum who used to work on the Docker and Microsoft technology partnership. /build/demo WORKDIR /build/demo/ RUN pwd; ls RUN chmod. The same container that a developer builds and tests on a laptop can run at scale, in production, on VMs, bare metal, OpenStack clusters, public clouds and more. i can confirm this when i run the psql db i cannot see any table created. On your current machine, make a local Halyard config directory. UPDATE: The docker-compose file has been updated to allow django server send logs to logstash properly. Summary: Learn the basics about Docker, and see how to use it for PowerShell Core script testing on different operating systems. Docker Compose The way we recommend running Artifactory on Docker is to orchestrate your setup using Docker Compose. yml syntax (with some additions) and the --compose-file option. While working on recent blog post on Integrating SQL Server 2017 Linux with ASP. vagrant ssh (from the command line interface and still from the same directory) we can create a terminal session into the VM. sh" script (if on Windows open this script and run its command directly, docker-compose logs --follow essbase) to specifically attach and follow the console output from the Essbase container:. Net Core using Docker I cam across a strange behavior. Docker Windows SQL Server Containers and Database Clones Scripts are run during the parent VHD build, creating an immutable artifact that incorporates user permissions, data masking, and other. Docker compose automatically create an internal network that enable containers to access each other. This file is pretty similar to the docker-compose. MongoDB Atlas is the global cloud database service for modern applications. by Kangze Huang Docker: Easy as build, run, done! Docker has been getting a lot of buzz recently, and for good reason. This looks for Kubernetes configuration in all. This post will show you how to setup a Swarm Cluster, deploy a couple of microservices, and create a Reverse Proxy Service (with Traefik) in charge of routing requests on their base URLs. Try it out: $ docker run --rm hello-world Enable docker to be run after reboot $ sudo systemctl enable docker Install docker-compose. Docker compose. sh script with sudo access. volumes: -. d/ So here I'm just pulling from the official repo, and adding "test. In this Quick Hit, I will describe how to create a containerized PHP + MySQL development environment using Docker Compose. Sitecore 9 with Solr and SQL Server running in Docker the script to run on startup, docker we configured in docker-compose. Make sure you have Docker CE installed. hal directory to ensure Halyard can read and write to it. Now let’s see the various Docker commands on the Windows OS. Dockerfiles enable you to create your own images. Postgres and Keycloak. docker run -p 1433:1433 --name sqldb -d northwind:1. In case it. Learn how to run MySQL and PostgreSQL on Docker using Docker Compose to configure the container service definitions. You’ll start with a simple app that uses hard-coded data, then add SQL Server for persistent storage, and a proxy to improve web performance. Four will be Windows containers from Andrews Docker hub repositories or Microsoft’s Docker Hub for SQL 2012, SQL 2014, SQL 2016, and SQL 2017 and one will be the latest Ubuntu SQL 2019 CTP 2. Hey Gary A, really a great tutorial. (the containers do not keep running). We have configured Jenkins in the docker compose file to run on port 8080 to Docker Login in the script file. If you rebuild the Docker image and run Docker compose again, the start script should run Apache and serve the Laravel application: docker-compose down docker-compose build docker-compose up Running a Scheduler. For a full list please see docker runreference. Build and run your first Docker Windows Server container By Michael Friis. docker-compose build mysql_server. This is on an Ubuntu 14. It just wasn't easy to get working on Windows at first. Then, with a single command, you create. The containerization service makes deploying microservices easy and stable, as each service can run an OS in its own virtual environment. WARNING: The Docker Engine you're using is running in swarm mode. Since the image is already built for us by Microsoft, I am just going to show the docker-compose file that can be used to automate rebuilding a container as each CTP is released for 2019. sh script that runs it all:. This image consists of SQL Server running on Linux based on Ubuntu 16. yml' can be found below. Make sure to substitute your Droplet IP address. docker rm -f mysql_server. NET Core with SQL Server Estimated reading time: 6 minutes This quick-start guide demonstrates how to use Docker Engine on Linux and Docker Compose to set up and run the sample ASP. Service Dependencies. In simple scenarios, this will work out of the box: Docker translates the Compose file into Kubernetes resources (Deployment, Service, etc. Docker-compose up Docker-compose down. gzip and bzip2 both use the same meaning for -dc as xz. To execute our database environment, we simply need to call docker run with a few arguments. Stack Exchange Network. On your current machine, make a local Halyard config directory. You may run laradock with or without docker-sync at any time using with the same. The Docker client initiates a request to a Docker daemon (Server). This guide assumes you have Docker and docker-compose installed on a server with at least 1GB of RAM memory. There's a very common pattern used to initialize stateful data in a container at runtime. Docker Compose solves this problem by allowing you to use a YAML file to define multi-container apps. sh in GitHub. docker build --build-arg [email protected] -t northwind:1. If you look at line 46 below we are using the environment variable ${MYSQL_PASSWORD}. We have docker images for these scripts/apps. This post is a continuation of Using Django with Elasticsearch, Logstash, and Kibana (ELK Stack) SOURCE CODE FOR THIS POST. The Docker extension contributes explorers to view and manage containers, images, registries, volumes, and networks. Here, I have my data-dump. Still inside the app folder, we can run any command inside a defined service container with the help of the docker-compose command. CKAN source. Docker Tip #49: Importing a Database SQL File with Docker Compose When dealing with databases such as PostgreSQL, MariaDB or MySQL, you've likely wanted to import a raw SQL file. There’s a docker compose file in the main directory of the repository that does everything. sql — an SQL script to initialize the database before the first time the app runs We will use docker. yml and run docker-compose up -d to start GitLab; Read “Pre-configure Docker container” to see how the GITLAB_OMNIBUS_CONFIG variable works. In the Kibana dashboard, you will be able to see an overview of all the SQL statements done by a pg_restore command, and look for any errors. sql is not being run in the Dockerfile. AzerothCore running on Windows 10 with Docker. We showed how to run multiple MySQL containers locally and how to access them from applications. yml, run the following command from the same directory # where docker-compose. SQL Server in Docker. js / Express. I discovered that by editing the docker-compose. Adding a Database for Compose # ADD seed. py for the logging settings. Also, the docker run command creates a container from the image library. This file is pretty similar to the docker-compose. NET Core with SQL Server Estimated reading time: 6 minutes This quick-start guide demonstrates how to use Docker Engine on Linux and Docker Compose to set up and run the sample ASP. FROM mysql ADD init. I'm on windows 10 PRO with Docker for Windows. Pipeline Support. To execute our database environment, we simply need to call docker run with a few arguments. I've already tried to delete both the container and the image to pull it again but without success. We have to create the Vonk database on the host. SQL Server をコマンドライン操作するのに便利な sql-cli というツールがあるので入れる。 hasankhan/sql-cli: Cross platform command line interface for SQL Server. Many containerized applications, especially stateful ones, have a way of running init scripts (like the sql scripts here) and they are supposed to run only once. Four will be Windows containers from Andrews Docker hub repositories or Microsoft’s Docker Hub for SQL 2012, SQL 2014, SQL 2016, and SQL 2017 and one will be the latest Ubuntu SQL 2019 CTP 2. It’s a way to make applications even more distributed, and strip them down into specific functions. NET Core SDK image with the SQL Server on Linux image. I have to run two sql scripts on start of mysql server. After joining a swarm, they are referred to as nodes. $ docker build. But there is a catch: this will run the app on the Kubernetes cluster running within Docker Destkop on our machine. Different versions/Multiple instances We can start as many instances on an On-premise Server/Laptop as we want. Bringing the SQL commands into a separate. To test why my SQL server image is not working, I removed the start. Finally, to bring down the entire application and remove the containers, images, volumes, and networks entirely, use the `down` command. We can run a copy of SQL Server without it touching our local machine. Creating Your First SQL Server Docker Container in macOS The use of macOS by developers and IT professionals has gained popularity the past few years. sh creates modularity between the commands that should be run at container start up time and the SQL commands that need to be run. First, download one (or both) of the following example docker-compose. do you have any tutorial or advice to try to run the jobs that you upload to the repository on Jenkits?. Ubuntu install Node. They have added this block to allow. Create a shell script with the following contents (named docker-entrypoint. Docker Compose The way we recommend running Artifactory on Docker is to orchestrate your setup using Docker Compose. Management Command Line Tool The management plugin ships with a command line tool rabbitmqadmin which can perform some of the same actions as the Web-based UI, and which may be more convenient for automation tasks. First one being the usage of the pre-built image for our ASP. sh creates modularity between the commands that should be run at container start up time and the SQL commands that need to be run. do you have any tutorial or advice to try to run the jobs that you upload to the repository on Jenkits?. com helps developers connect software to data. Docker Compose. Run docker-compose up data-server. Not long ago, Mastodon, an open source, federated alternative to the proprietary network-effect wunderkind, Twitter, came out of no where. Declarative views make your code more predictable and easier to debug. Setup postgres in docker container and run init. Before I look at consul and other service discovery tools, I wanted to understand how linking works in Docker using Docker-Compose. d, so I don't understand why the database isn't populated. Postgres and Keycloak. The output will run the command in the desired container. sh # located at. The fact-checkers, whose work is more and more important for those who prefer facts over lies, police the line between fact and falsehood on a day-to-day basis, and do a great job. Today, my small contribution is to pass along a very good overview that reflects on one of Trump’s favorite overarching falsehoods. Namely: Trump describes an America in which everything was going down the tubes under  Obama, which is why we needed Trump to make America great again. And he claims that this project has come to fruition, with America setting records for prosperity under his leadership and guidance. “Obama bad; Trump good” is pretty much his analysis in all areas and measurement of U.S. activity, especially economically. Even if this were true, it would reflect poorly on Trump’s character, but it has the added problem of being false, a big lie made up of many small ones. Personally, I don’t assume that all economic measurements directly reflect the leadership of whoever occupies the Oval Office, nor am I smart enough to figure out what causes what in the economy. But the idea that presidents get the credit or the blame for the economy during their tenure is a political fact of life. Trump, in his adorable, immodest mendacity, not only claims credit for everything good that happens in the economy, but tells people, literally and specifically, that they have to vote for him even if they hate him, because without his guidance, their 401(k) accounts “will go down the tubes.” That would be offensive even if it were true, but it is utterly false. The stock market has been on a 10-year run of steady gains that began in 2009, the year Barack Obama was inaugurated. But why would anyone care about that? It’s only an unarguable, stubborn fact. Still, speaking of facts, there are so many measurements and indicators of how the economy is doing, that those not committed to an honest investigation can find evidence for whatever they want to believe. Trump and his most committed followers want to believe that everything was terrible under Barack Obama and great under Trump. That’s baloney. Anyone who believes that believes something false. And a series of charts and graphs published Monday in the Washington Post and explained by Economics Correspondent Heather Long provides the data that tells the tale. The details are complicated. Click through to the link above and you’ll learn much. But the overview is pretty simply this: The U.S. economy had a major meltdown in the last year of the George W. Bush presidency. Again, I’m not smart enough to know how much of this was Bush’s “fault.” But he had been in office for six years when the trouble started. So, if it’s ever reasonable to hold a president accountable for the performance of the economy, the timeline is bad for Bush. GDP growth went negative. Job growth fell sharply and then went negative. Median household income shrank. The Dow Jones Industrial Average dropped by more than 5,000 points! U.S. manufacturing output plunged, as did average home values, as did average hourly wages, as did measures of consumer confidence and most other indicators of economic health. (Backup for that is contained in the Post piece I linked to above.) Barack Obama inherited that mess of falling numbers, which continued during his first year in office, 2009, as he put in place policies designed to turn it around. By 2010, Obama’s second year, pretty much all of the negative numbers had turned positive. By the time Obama was up for reelection in 2012, all of them were headed in the right direction, which is certainly among the reasons voters gave him a second term by a solid (not landslide) margin. Basically, all of those good numbers continued throughout the second Obama term. The U.S. GDP, probably the single best measure of how the economy is doing, grew by 2.9 percent in 2015, which was Obama’s seventh year in office and was the best GDP growth number since before the crash of the late Bush years. GDP growth slowed to 1.6 percent in 2016, which may have been among the indicators that supported Trump’s campaign-year argument that everything was going to hell and only he could fix it. During the first year of Trump, GDP growth grew to 2.4 percent, which is decent but not great and anyway, a reasonable person would acknowledge that — to the degree that economic performance is to the credit or blame of the president — the performance in the first year of a new president is a mixture of the old and new policies. In Trump’s second year, 2018, the GDP grew 2.9 percent, equaling Obama’s best year, and so far in 2019, the growth rate has fallen to 2.1 percent, a mediocre number and a decline for which Trump presumably accepts no responsibility and blames either Nancy Pelosi, Ilhan Omar or, if he can swing it, Barack Obama. I suppose it’s natural for a president to want to take credit for everything good that happens on his (or someday her) watch, but not the blame for anything bad. Trump is more blatant about this than most. If we judge by his bad but remarkably steady approval ratings (today, according to the average maintained by 538.com, it’s 41.9 approval/ 53.7 disapproval) the pretty-good economy is not winning him new supporters, nor is his constant exaggeration of his accomplishments costing him many old ones). I already offered it above, but the full Washington Post workup of these numbers, and commentary/explanation by economics correspondent Heather Long, are here. On a related matter, if you care about what used to be called fiscal conservatism, which is the belief that federal debt and deficit matter, here’s a New York Times analysis, based on Congressional Budget Office data, suggesting that the annual budget deficit (that’s the amount the government borrows every year reflecting that amount by which federal spending exceeds revenues) which fell steadily during the Obama years, from a peak of $1.4 trillion at the beginning of the Obama administration, to $585 billion in 2016 (Obama’s last year in office), will be back up to $960 billion this fiscal year, and back over $1 trillion in 2020. (Here’s the New York Times piece detailing those numbers.) Trump is currently floating various tax cuts for the rich and the poor that will presumably worsen those projections, if passed. As the Times piece reported: