Giter VIP home page Giter VIP logo

Comments (7)

northosts avatar northosts commented on May 24, 2024

Hi

thanks for trying out wuxt. I just did a fresh clone and install and everything worked. Check if the mysql container is running docker ps. If there is no mysql.wuxt in the list the start of that container failed. Check the logs of the failed container in that case docker logs mysql.wuxt. What OS are you using, is docker working fine otherwise? Do you have a lokal mysql running? try to stop it and run docker-compose up -d another time.

Hope that helps!

from wuxt.

Ansonhkg avatar Ansonhkg commented on May 24, 2024

I'm running Windows 10 Pro. All containers are up and running, just unable to establish a database connection. Managed to fix it though by adding networks: -default to wo-wuxt. Thanks.

wp.wuxt:
    container_name: wp.wuxt
    image: wordpress:5.1.1-php7.2-apache
    volumes:
      - ./wp-content:/var/www/html/wp-content
    expose:
      - '3080'
    ports:
      - '3080:80'
    environment:
      WORDPRESS_DB_HOST: mysql.wuxt:3306
      WORDPRESS_DB_NAME: wuxt
      WORDPRESS_DB_USER: root
      WORDPRESS_DB_PASSWORD: dev
    networks:
      - default

from wuxt.

northosts avatar northosts commented on May 24, 2024

nice catch! added the network definition to all containers now, hope this solves the problems.

from wuxt.

Narixius avatar Narixius commented on May 24, 2024

Hi,
I still have this problem and I don't know how to solve this...
When I run sudo docker-compose up -d docker will start successfully

Starting front.wuxt ... done
Starting mysql.wuxt ... done
Starting wp.wuxt    ... done

But Wordpress shows this error

Error establishing a database connection
This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at mysql.wuxt:3306. This could mean your host’s database server is down.

My docker-compose.yml content :

services:
    mysql.wuxt:
        container_name: mysql.wuxt
        image: mysql:5.7
        volumes:
            - ./_db:/var/lib/mysql
        environment:
            MYSQL_ROOT_PASSWORD: dev
        networks:
          - default

    wp.wuxt:
        container_name: wp.wuxt
        image: wordpress:5.2.2-php7.2-apache
        volumes:
          - ./wp-content:/var/www/html/wp-content
        expose:
          - '3080'
        ports:
          - '3080:80'
        environment:
          WORDPRESS_DB_HOST: mysql.wuxt:3306
          WORDPRESS_DB_NAME: wuxt
          WORDPRESS_DB_USER: root
          WORDPRESS_DB_PASSWORD: dev
        networks:
          - default

    front.wuxt:
        container_name: front.wuxt
        image: node:11-slim
        working_dir: '/var/www/app'
        environment:
            - HOST=0.0.0.0
        ports:
            - '3000:3000'
        volumes:
            - ./nuxt:/var/www/app
        command: bash -c "yarn install && yarn dev"
        networks:
          - default

networks:
    default:

from wuxt.

northosts avatar northosts commented on May 24, 2024

It seems like your database is not running, even when the docker-container starts it might shut down because of errors directly after. Try the following to give us some more information.

After starting the containers, run docker ps -a and check if the mysql.wuxt container is actually running or has been shut down directly after start. Then run docker logs mysql.wuxt and check if there have been logged errors.

Some reasons I can think of, why the db is not active:

  • write permissions on the _db folder
  • mysql port used by a local mysql version on the host
  • errors when initializing the db
  • memory/cpu/disk-space?

Please post your findings here again, thanks! Won't open the issue again, because I'm quite sure right now it's with your local environment.

from wuxt.

Narixius avatar Narixius commented on May 24, 2024

Hi, thank you for helping.
This is the result of sudo docker ps -a
image
And this is the logs of mysql.wuxt :

[Note] mysqld (mysqld 5.7.26) starting as process 1 ...
[Note] InnoDB: PUNCH HOLE support available
[Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
[Note] InnoDB: Uses event mutexes
[Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
[Note] InnoDB: Compressed tables use zlib 1.2.11
[Note] InnoDB: Using Linux native AIO
[Note] InnoDB: Number of pools: 1
[Note] mysqld (mysqld 5.7.26) starting as process 1 ...
[Note] InnoDB: Using CPU crc32 instructions
[Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
[Note] InnoDB: Completed initialization of buffer pool
[Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
[Note] InnoDB: Highest supported file format is Barracuda.
[Note] InnoDB: Creating shared tablespace for temporary tables
[Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
[Note] InnoDB: File './ibtmp1' size is now 12 MB.
[Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
[Note] InnoDB: 32 non-redo rollback segment(s) are active.
[Note] InnoDB: Waiting for purge to start
[Note] InnoDB: 5.7.26 started; log sequence number 2530624
[Note] Plugin 'FEDERATED' is disabled.
[Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
[Warning] World-writable config file './auto.cnf' is ignored.
[Warning] World-writable config file './ [Note] Salting uuid generator variables, current_pid: 1, server_start_time: 1561669396, bytes_sent: 0, 
[Note] Generated uuid: 'fc18f421-991e-11e9-896f-0242ac120003', server_start_time: 281476538380053, bytes_sent: 94390283916320
[Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: fc18f421-991e-11e9-896f-0242ac120003.
[Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
[Warning] CA certificate ca.pem is self signed.
[Note] InnoDB: Buffer pool(s) load completed at 190627 21:03:16
[Note] Server hostname (bind-address): '*'; port: 3306
[Note] IPv6 is available.
[Note]   - '::' resolves to '::';
[Note] Server socket created on IP: '::'.
[Warning] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
[Note] Event Scheduler: Loaded 0 events
[Note] mysqld: ready for connections.
Version: '5.7.26'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server (GPL)

The chmod of _db is 777 and I've stopped mysqld service before running docker command also I guess I don't have any problem with memory, cpu or disks-space.
I still have the problem and can't solve it.
Thanks for helping.

from wuxt.

Ansonhkg avatar Ansonhkg commented on May 24, 2024

@NarimanMov Long shot - Where did you host your project? For some reasons, I tried to host the application in D:/ but it appears Error establishing a database connection just like you did. However, when I place it under C:/ everything works perfectly. Have you tried that?

from wuxt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.