Skip to content

Commit

Permalink
add mariadb
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsilen committed Aug 19, 2024
1 parent 9442259 commit 1b526e1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions docs/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,8 @@ Why do I only see black screens with a timestamp when monitoring my camera?
In the monitor windows where you see the black screen with a timestamp, select settings and enter the Brightness, Contrast, Hue, and Color settings reported for the device by ``zmu -d <device_path> -q -v``. 32768 may be appropriate values to try for these settings. After saving the settings, select Settings again to confirm they saved successfully.


How do I repair the MySQL Database?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
How do I repair the MySQL/MariaDB Database?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
There is two ways to go about this. In most cases you can run from the command prompt ->
``mysqlcheck --all-databases --auto-repair -p your_database_password -u your_databse_user``

Expand All @@ -491,9 +491,9 @@ If that does not work then you will have to make sure that ZoneMinder is stopped
``myisamchk --silent --force --fast --update-state -O key_buffer=64M -O sort_buffer=64M -O read_buffer=1M -O write_buffer=1M /var/lib/mysql/*/*.MYI``


How do I repair the MySQL Database when the cli fails?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
In Ubuntu, the commands listed above do not seem to work. However, actually doing it by hand from within MySQL does. (But that is beyond the scope of this document) But that got me thinking... And phpmyadmin does work. Bring up a terminal.
How do I repair the MySQL/MariaDB Database when the cli fails?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
In Ubuntu, the commands listed above do not seem to work. However, actually doing it by hand from within MySQL/MariaDB does. (But that is beyond the scope of this document) But that got me thinking... And phpmyadmin does work. Bring up a terminal.
``sudo apt-get install phpmyadmin``

Now go to ``http://zoneminder_IP/`` and stop the ZM service. Continue to ``http://zoneminder_IP/phpmyadmin`` and select the zoneminder database. Select and tables marked 'in use' and pick the action 'repare' to fix. Restart the zoneminder service from the web browser. Remove or disable the phpmyadmin tool, as it is not always the most secure thing around, and opens your database wide to any skilled hacker.
Expand All @@ -508,8 +508,8 @@ Any time you update a major version that ZoneMinder depends on, you need to reco
Zoneminder doesn't start automatically on boot
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Check the list for log entries like "zmfix[766]: ERR [Can't connect to server: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)] ".
What can happen is that zoneminder is started too quickly after Mysql and tries to contact the database server before it's ready. Zoneminder gets no answer and aborts.
August 2010 - Ubuntu upgrades seem to be leaving several systems in this state. One way around this is to add a delay to the zoneminder startup script allowing Mysql to finish starting.
What can happen is that zoneminder is started too quickly after MySQL/MariaDB and tries to contact the database server before it's ready. Zoneminder gets no answer and aborts.
August 2010 - Ubuntu upgrades seem to be leaving several systems in this state. One way around this is to add a delay to the zoneminder startup script allowing MySQL/MariaDB to finish starting.
"Simply adding 'sleep 15' in the line above 'zmfix -a' in the /etc/init.d/zoneminder file fixed my ZoneMinder startup problems!" - credit to Pada.

Remote Path setup for Panasonic and other Camera
Expand Down
4 changes: 2 additions & 2 deletions docs/installationguide/multiserver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ New installs

.. sidebar :: Note
For systemd based linux distros, inspect the zoneminder service file, typically found under /lib/systemd/system. Changes may be required for multiserver to function correctly. For example, the service file may check for a running instance of mysql or mariadb running locally on the server. This check will need to be removed. Rather than edit the service file directly, copy the service file to /etc/systemd/system and edit the file in that location.
For systemd based linux distros, inspect the zoneminder service file, typically found under /lib/systemd/system. Changes may be required for multiserver to function correctly. For example, the service file may check for a running instance of MySQL or MariaDB running locally on the server. This check will need to be removed. Rather than edit the service file directly, copy the service file to /etc/systemd/system and edit the file in that location.
2. On each ZoneMinder server, edit zm.conf. Find the ZM_DB_HOST variable and set it to the name or ip address of your Database Server. Find the ZM_SERVER_HOST and enter a name for this ZoneMinder server. Use a name easily recognizable by you. This name is not used by ZoneMinder for dns or any other form of network connectivity.

3. Copy the file /usr/share/zoneminder/db/zm_create.sql from one of the ZoneMinder Servers to the machine targeted as the Database Server.

4. Install mysql/mariadb server onto the Database Server.
4. Install MySQL/MariaDB server onto the Database Server.

5. It is advised to run "mysql_secure_installation" to help secure the server.

Expand Down

0 comments on commit 1b526e1

Please sign in to comment.