Is MyPhpAdmin installed from docker? + import questions


#1

Hi, im new to the docker version of xibo and i have a few questions:

  • I need to import my sql database from a previous installation but i cant seem to find a installationguide on myphpadmin for xibo, but in all the backup guides myphpadmin us used? Is it installed from the beginning? If so, how do i access it?

  • I have a few html scripts that i have to use, where do i store these? And what is the url to acces them?


#2

You can import your database by following the guide on upgrading from an earlier version (http://xibo.org.uk/manual-tempel/en/upgrade.html#switching_to_docker). The container is setup to look for an import.sql file.

If you want to have PHPMyAdmin available to you, you can do so by running it in it’s own container. That’s covered in the following FAQ:

Your custom HTML goes in shared/cms/userscripts and is available at http://server.domain.com/userscripts where server.domain.com is the IP address or DNS name for your server.


#3

Thank You! But i get an error when i try to import it, i put the import.sql in the backup folder and run docker-compose up and get the following:

cms-web_1 | Attempting to import database
cms-web_1 | Importing Database
cms-web_1 | ERROR 1062 (23000) at line 44 in file: ‘/var/www/backup/import.sql’: Duplicate entry ‘1’ for key 'PRIMARY’
cms-web_1 | Configuring Database Settings
cms-web_1 | Setting up Maintenance
cms-web_1 | mv: ‘/var/www/backup/import.sql’ and ‘/var/www/backup/import.sql.done’ are the same file
cms-web_1 | DBVersion
cms-web_1 | 132

What does this mean?


#4

Perhaps you already ran docker-compose up before that, and have a database already created?

You can only import the first time the containers are run.

If so, do the following. This will remove the existing database and import your old one.

docker-compose down
rm -r shared/db
mv shared/backup/import.sql.done shared/backup/import.sql
docker-compose up -d

Since you’re importing an existing database, you’ll also need to run a SQL command after the database has been successfully imported. Use the FAQ I linked previously to run the following:

UPDATE setting SET value="/var/www/cms/library/", userChange=0, userSee=0 WHERE setting="LIBRARY_LOCATION";

#5

Sorry for the dumb question…

C:\xibo-docker>rm -r shared/db
’rm’ is not recognized as an internal or external command,
operable program or batch file.


#6

I assumed a Linux host since you didn’t say what you were running on.

In that case

docker-compose down
del /s shared\db
move shared\backup\import.sql.done shared\backup\import.sql
docker-compose up -d

Then the SQL per my previous post.


#7

Thank you for your patience, i now get the following:

ERROR 2005 (HY000): Unknown MySQL server host ‘mysql’ (0)


#8

… at which stage?

The more information you give, the more likely I am to be able to help you.


#9

C:\xibo-docker>docker exec -ti xibodocker_cms-web_1 bash
root@c41848b28135:/# mysql -u cms -h mysql -p cms
Enter password:
ERROR 2005 (HY000): Unknown MySQL server host ‘mysql’ (0)


#10

Strange. The mysql host should be available.

Did the previous step complete without errors? What does docker-compose logs show?


#11

It did seem to work before, the logs says the following:

C:\xibo-docker>docker-compose logs
Attaching to xibodocker_cms-web_1, xibodocker_cms-db_1, xibodocker_cms-xmr_1
cms-db_1 | 2017-05-31 11:06:44 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
cms-db_1 | 2017-05-31 11:06:44 0 [Note] mysqld (mysqld 5.6.36) starting as process 1 …
cms-db_1 | 2017-05-31 11:06:50 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
cms-db_1 | 2017-05-31 11:06:50 0 [Note] mysqld (mysqld 5.6.36) starting as process 1 …
cms-db_1 | 2017-05-31 11:06:53 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
cms-db_1 | 2017-05-31 11:06:53 0 [Note] mysqld (mysqld 5.6.36) starting as process 1 …
cms-db_1 | 2017-05-31 11:06:56 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
cms-db_1 | 2017-05-31 11:06:56 0 [Note] mysqld (mysqld 5.6.36) starting as process 1 …
cms-db_1 | 2017-05-31 11:07:00 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
cms-db_1 | 2017-05-31 11:07:00 0 [Note] mysqld (mysqld 5.6.36) starting as process 1 …
cms-db_1 | 2017-05-31 11:07:09 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
cms-db_1 | 2017-05-31 11:07:09 0 [Note] mysqld (mysqld 5.6.36) starting as process 1 …
cms-db_1 | 2017-05-31 11:07:14 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
cms-db_1 | 2017-05-31 11:07:14 0 [Note] mysqld (mysqld 5.6.36) starting as process 1 …
cms-db_1 | 2017-05-31 11:07:23 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
cms-db_1 | 2017-05-31 11:07:23 0 [Note] mysqld (mysqld 5.6.36) starting as process 1 …
cms-db_1 | 2017-05-31 11:07:38 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
cms-db_1 | 2017-05-31 11:07:38 0 [Note] mysqld (mysqld 5.6.36) starting as process 1 …
cms-db_1 | 2017-05-31 11:08:06 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
cms-db_1 | 2017-05-31 11:08:06 0 [Note] mysqld (mysqld 5.6.36) starting as process 1 …
cms-db_1 | 2017-05-31 11:09:00 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
cms-db_1 | 2017-05-31 11:09:00 0 [Note] mysqld (mysqld 5.6.36) starting as process 1 …
cms-db_1 | 2017-05-31 11:10:45 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
cms-db_1 | 2017-05-31 11:10:45 0 [Note] mysqld (mysqld 5.6.36) starting as process 1 …
cms-db_1 | 2017-05-31 11:14:12 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
cms-db_1 | 2017-05-31 11:14:12 0 [Note] mysqld (mysqld 5.6.36) starting as process 1 …
cms-web_1 | Waiting for MySQL to start - max 300 seconds
cms-web_1 | MySQL started
cms-web_1 | Attempting to import database
cms-web_1 | Importing Database
cms-web_1 | ERROR 2005 (HY000): Unknown MySQL server host ‘mysql’ (0)
cms-web_1 | Configuring Database Settings
cms-web_1 | ERROR 2005 (HY000): Unknown MySQL server host ‘mysql’ (0)
cms-web_1 | ERROR 2005 (HY000): Unknown MySQL server host ‘mysql’ (0)
cms-web_1 | ERROR 2005 (HY000): Unknown MySQL server host ‘mysql’ (0)
cms-web_1 | ERROR 2005 (HY000): Unknown MySQL server host ‘mysql’ (0)
cms-web_1 | ERROR 2005 (HY000): Unknown MySQL server host ‘mysql’ (0)
cms-web_1 | Setting up Maintenance
cms-web_1 | ERROR 2005 (HY000): Unknown MySQL server host ‘mysql’ (0)
cms-web_1 | ERROR 2005 (HY000): Unknown MySQL server host ‘mysql’ (0)
cms-web_1 | mv: ‘/var/www/backup/import.sql’ and ‘/var/www/backup/import.sql.done’ are the same file
cms-web_1 | ERROR 2005 (HY000): Unknown MySQL server host ‘mysql’ (0)
cms-web_1 | New install
cms-web_1 | Provisioning Database
cms-web_1 | ERROR 2005 (HY000): Unknown MySQL server host ‘mysql’ (0)
cms-web_1 | ERROR 2005 (HY000): Unknown MySQL server host ‘mysql’ (0)
cms-web_1 | ERROR 2005 (HY000): Unknown MySQL server host ‘mysql’ (0)
cms-web_1 | Configuring Database Settings
cms-web_1 | ERROR 2005 (HY000): Unknown MySQL server host ‘mysql’ (0)
cms-web_1 | ERROR 2005 (HY000): Unknown MySQL server host ‘mysql’ (0)
cms-web_1 | ERROR 2005 (HY000): Unknown MySQL server host ‘mysql’ (0)
cms-web_1 | ERROR 2005 (HY000): Unknown MySQL server host ‘mysql’ (0)
cms-web_1 | ERROR 2005 (HY000): Unknown MySQL server host ‘mysql’ (0)
cms-web_1 | ERROR 2005 (HY000): Unknown MySQL server host ‘mysql’ (0)
cms-web_1 | Setting up Maintenance
cms-web_1 | ERROR 2005 (HY000): Unknown MySQL server host ‘mysql’ (0)
cms-web_1 | ERROR 2005 (HY000): Unknown MySQL server host ‘mysql’ (0)
cms-web_1 | Updating settings.php
cms-web_1 | Configuring Backups
cms-web_1 | Configuring Maintenance
cms-web_1 | Running maintenance
cms-web_1 | Starting cron
cms-web_1 | Starting webserver
cms-web_1 | AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using 172.18.0.4. Set the ‘ServerName’ directive globally to suppress this message


#12

That looks like a bunch of errors to me.

Please can you down the containers (docker-compose down), and then ensure that the shared/db folder is completely empty, and that there are no containers running (docker ps) and then try again?

I suspect there’s something else going on here causing interference.


#13

Thank you so much, now the sql works (the db folder wasnt empty for some reason). But i cant access http://localhost anymore, i did a docker-compose up -d and waited a few minutes but localhost says “this page cant be displayed”


#14

What does docker-compose logs show?


#15

C:\xibo-docker>docker-compose logs
Attaching to xibodocker_cms-web_1, xibodocker_cms-db_1, xibodocker_cms-xmr_1
cms-web_1 | Waiting for MySQL to start - max 300 seconds
cms-web_1 | MySQL started
cms-web_1 | Attempting to import database
cms-web_1 | Importing Database
cms-web_1 | Configuring Database Settings
cms-web_1 | Setting up Maintenance
cms-web_1 | DBVersion
cms-web_1 | 94
cms-web_1 | Updating settings.php
cms-web_1 | Configuring Backups
cms-web_1 | Configuring Maintenance
cms-web_1 | Waiting for MySQL to start - max 300 seconds
cms-web_1 | MySQL started
cms-web_1 | DBVersion
cms-web_1 | 94
cms-web_1 | Configuring Backups
cms-web_1 | Configuring Maintenance
cms-web_1 | Running maintenance
cms-web_1 | Starting cron
cms-web_1 | Starting webserver
cms-web_1 | AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using 172.18.0.4. Set the ‘ServerName’ directive globally to suppress this message
cms-db_1 | Initializing database
cms-db_1 | 2017-05-31 11:25:34 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
cms-db_1 | 2017-05-31 11:25:34 0 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
cms-db_1 | 2017-05-31 11:25:34 0 [Note] /usr/sbin/mysqld (mysqld 5.6.36) starting as process 36 …
cms-db_1 |
cms-db_1 |
cms-db_1 | 2017-05-31 11:25:45 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
cms-db_1 | 2017-05-31 11:25:45 0 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
cms-db_1 | 2017-05-31 11:25:45 0 [Note] /usr/sbin/mysqld (mysqld 5.6.36) starting as process 59 …
cms-db_1 |
cms-db_1 |
cms-db_1 |
cms-db_1 |
cms-db_1 | PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
cms-db_1 | To do so, start the server, then issue the following commands:
cms-db_1 |
cms-db_1 | /usr/bin/mysqladmin -u root password 'new-password’
cms-db_1 | /usr/bin/mysqladmin -u root -h 8132ea3fc6d9 password 'new-password’
cms-db_1 |
cms-db_1 | Alternatively you can run:
cms-db_1 |
cms-db_1 | /usr/bin/mysql_secure_installation
cms-db_1 |
cms-db_1 | which will also give you the option of removing the test
cms-db_1 | databases and anonymous user created by default. This is
cms-db_1 | strongly recommended for production servers.
cms-db_1 |
cms-db_1 | See the manual for more instructions.
cms-db_1 |
cms-db_1 | Please report any problems at http://bugs.mysql.com/
cms-db_1 |
cms-db_1 | The latest information about MySQL is available on the web at
cms-db_1 |
cms-db_1 | http://www.mysql.com
cms-db_1 |
cms-db_1 | Support MySQL by buying support/licenses at http://shop.mysql.com
cms-db_1 |
cms-db_1 | Note: new default config file not created.
cms-db_1 | Please make sure your config file is current
cms-db_1 |
cms-db_1 | WARNING: Default config file /etc/mysql/my.cnf exists on the system
cms-db_1 | This file will be read by default by the MySQL server
cms-db_1 | If you do not want to use this, either remove it, or use the
cms-db_1 | --defaults-file argument to mysqld_safe when starting the server
cms-db_1 |
cms-db_1 | Database initialized
cms-db_1 | MySQL init process in progress…
cms-db_1 | 2017-05-31 11:25:48 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
cms-db_1 | 2017-05-31 11:25:48 0 [Note] mysqld (mysqld 5.6.36) starting as process 87 …
cms-db_1 | Warning: Unable to load ‘/usr/share/zoneinfo/iso3166.tab’ as time zone. Skipping it.
cms-db_1 | Warning: Unable to load ‘/usr/share/zoneinfo/leap-seconds.list’ as time zone. Skipping it.
cms-db_1 | Warning: Unable to load ‘/usr/share/zoneinfo/zone.tab’ as time zone. Skipping it.
cms-db_1 | GENERATED ROOT PASSWORD: odaejo0DeeyoPheongechach2ietu7ee
cms-db_1 | Warning: Using a password on the command line interface can be insecure.
cms-db_1 | Warning: Using a password on the command line interface can be insecure.
cms-db_1 | Warning: Using a password on the command line interface can be insecure.
cms-db_1 | Warning: Using a password on the command line interface can be insecure.
cms-db_1 |
cms-db_1 |
cms-db_1 | MySQL init process done. Ready for start up.
cms-db_1 |
cms-db_1 | 2017-05-31 11:25:53 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
cms-db_1 | 2017-05-31 11:25:53 0 [Note] mysqld (mysqld 5.6.36) starting as process 1 …
cms-db_1 | 2017-05-31 11:30:23 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
cms-db_1 | 2017-05-31 11:30:23 0 [Note] mysqld (mysqld 5.6.36) starting as process 1 …


#16

It all looks like it should be up and running.

What does docker ps show?


#17

Now it works! I guess it needed more time than i thougth, everything works in the cms too.

Thank you so much for your help.