search

Home  >  Q&A  >  body text

Using Docker to run Mariadb but the database is empty

<p>So, I can access running mysql inside the virtual machine using: mysql -h (mariadb's IP) -u (user) -p (password) database name Now when I try to create the following command to run mariadb inside a docker container: [ref] (How to access mariadb on docker remotely?). Then when I display the table, it displays <strong>Empty Set (0.000 seconds)</strong>. Not sure why I can't see the data through docker. I also tried using docker ip as container, same thing. Does anyone know a solution to this problem? Thank you in advance. </p>
P粉364129744P粉364129744471 days ago538

reply all(1)I'll reply

  • P粉144705065

    P粉1447050652023-09-01 10:44:05

    I can figure it out. I just had to do something like this - Sometimes, you need to specify the server's port or force TCP mode:

    mysql -h 173.18.0.2 -P 3308 --protocol=TCP -u root -p

    reply
    0
  • Cancelreply