Skip to content

Clarification about PHP mysql configuration #571

Description

@MichaIng

Related to: https://help.nextcloud.com/t/clarification-about-php-mysql-configuration/21807

Hey there,

according to admin manual, the following php mysql module configuration could be used: https://docs.nextcloud.com/server/12/admin_manual/configuration_database/linux_database_configuration.html#configuring-a-mysql-or-mariadb-database

# configuration for PHP MySQL module
extension=pdo_mysql.so

[mysql]
mysql.allow_local_infile=On
mysql.allow_persistent=On
mysql.cache_size=2000
mysql.max_persistent=-1
mysql.max_links=-1
mysql.default_port=
mysql.default_socket=/var/lib/mysql/mysql.sock  # Debian squeeze: /var/run/mysqld/mysqld.sock
mysql.default_host=
mysql.default_user=
mysql.default_password=
mysql.connect_timeout=60
mysql.trace_mode=Off

Is this something like a recommendation or an example to just show the available settings?
As can be seen, some values are empty, others have just the default value or dont even exist on php manual (http://php.net/manual/en/mysql.configuration.php)
and explicitly the manual just gives the advice to ensure that mysql.default_socket points to the right socket location. This makes sense, although it is handled and usually set right within default php.ini.

Besides, I am not sure, that at least since PHP7.0 these config values change anything about the pdo_mysql extension used by Nextcloud. This has it's own settings: http://php.net/manual/en/ref.pdo-mysql.php#pdo-mysql.configuration
pdo_mysql further depends on mysqlnd with again brings its own settings: http://php.net/manual/en/mysqlnd.config.php
So I am a bid confused if the mysql.<...> settings do have any influence. They also do not show up on phpinfo().

I use PHP7.0 with MariaDB 10.1 on Raspbian Stretch.

Activity

  1. tflidd commented on Jan 7, 2018

    @tflidd
    Contributor

    Is this something like a recommendation or an example to just show the available settings?

    This looks for me like the default debian settings. In debian, these options are already configured so no manual interaction is required. This could be different in other distributions, and it is mostly something to check if you have problems with your database connection.
    For database performance, it is much more interesting to optimize the cache settings of mysql itself.

    What changes to the documentation would you suggest @MichaIng ?

  2. MichaIng commented on Jan 9, 2018

    @MichaIng
    MemberAuthor

    @tflidd
    Thanks for reply.

    Yes, finally I also got that this can just be a list of available options+defaults and can/need to be ignored on usual installations. It is just not too clear for me, reading it.

    What changes to the documentation would you suggest

    Generally I would suggest only the usually required/recommended settings to be there, with links to further information, if needed. So the average user can simply follow the provided steps, without stumbling over several additional information, where (s)he doesn't know, if they matter, should be applied or can/should be ignored.
    I just refer to nextcloud/server#6449, where I guess most inexperienced user, including me for longer time, just used Satisfy Any within their apache nextcloud.conf, just in case, and opened their data folder (if inside nextcloud installation folder) to the web by this. I remember, that I saw the warning an admin manual, an was damn not able to figure out, what is wrong, as all .htaccess settings were right in place, running etc. Finally I moved my data folder outside, which is a good idea anyway. And just because it is still not yet made clear in admin manual, that you SHOULD ignore this and JUST if anything is not running and you know, that you use parent folder authentication AND you know, that your data folder is placed outside of nextcloud ones. But this is another story...

    In this case:

    If you think, most will agree, I could make a PR.

  3. tflidd commented on Jan 11, 2018

    @tflidd
    Contributor

    I think a step-by-step guide is missing. We have a couple of guides which people created on their blogs and partly shared via help.nextcloud.com. I would prefer to keep a current one in the docs, or link to one which is kept up to date (ref: https://help.nextcloud.com/t/tutorial-sync-nextcloud-tasks-calendars-and-contacts-on-your-android-device/25249)

    Regarding the database setup, I think it is ok to try to set up the database via occ command and your approach looks good.

  4. MichaIng commented on Jan 12, 2018

    @MichaIng
    MemberAuthor

    @tflidd
    Yes, I mean it is hard to create a step-by-step guide that is valid for really every setup. All the user guides of course suit to their os (+version), database and webserver preference, which is totally okay. They are still of high value.
    As the admin manual is to be for every kind of users with different needs/preferences, it is not possible to make it really step-by-step. There always need to be the different sections for different webservers, databases etc. e.g. here the database page separated into MySQL/MariaDB and PostgreSQL. Or the "Server Configuration" where everyone needs to see, what (s)he needs.
    There would be some kind of selection system necessary, which, based on user input, matches the right parts of the manual together to follow step-by-step 😆.

    But the single sections should be as clean and easy to follow as possible, with just the adjustments/settings that are really necessary and as said just links to any further possible configurations. I already asked at some other place for something similar at the redis socket section: https://docs.nextcloud.com/server/12/admin_manual/configuration_server/caching_configuration.html#id3
    Besides the necessary two values, also the three 'dbindex', 'password' and 'timeout' are given inside the "example". Okay, beneath it is written, that these are just optional, but I personally would, to keep it clean and easy to follow/copy&paste, just give the minimum, which will fit for 90% of users, and then give a link to the "config.php parameters" section, where the other 3 parameters are explained.
    What is missing on the other hand is, the changes you need to make to redis.conf and allowing www-data access to the socket. A newbie, who is reading this and want's to use Redis via unix socket, as it "is recommended if Redis is running on the same system as Nextcloud" and then accordingly adjusts config.php, will not even directly know, that something is not working, until (s)he recognizes the log entries, about non-reachable redis server and end up on google/help.nextcloud.com 😉.

    The Ubuntu example installation of course is closer to a real step-by-step guide. But as said, database setup should be linked from there and the whole highly recommended SSL party, where I would for every home server newby clearly add certbot installation, also for simplicity, as it automates also webserver configuration.

  5. kesselb commented on Aug 17, 2019

    @kesselb
    Contributor

    Is this still relevant?

  6. MichaIng commented on Aug 17, 2019

    @MichaIng
    MemberAuthor

    @kesselb
    I will close this issue. I don't find the time currently to do larger documentation commits/PRs, but I have it in mind, if this changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions