# 进入nextcloud容器执行以下命令

```bash
chown -R www-data:www-data data
```

# 连接mysql执行以下命令
```sql
grant all privileges on *.* to root@'%';
flush privileges;
```

# 配置案例

```text
<?php
$CONFIG = array (
  'htaccess.RewriteBase' => '/',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 => 
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
  'instanceid' => 'octx8mmtfcpu',
  'passwordsalt' => 'lB4u3kGaVlKlyr3kEtI4JqGzobXlsm',
  'secret' => 'rPnKc/hokpMbk8liv9D/XNtElbLgOidLiwmD+9nQN/NmvEkV',
  'trusted_domains' => 
  array (
    0 => 'pan.guanweiming.com',
  ),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '25.0.3.2',
  'overwrite.cli.url' => 'https://pan.guanweiming.com:443',
  'overwritehost' => 'pan.guanweiming.com:443',
  'overwriteprotocol' => 'https',
  'dbname' => 'nextcloud',
  'dbhost' => 'mysql:3306',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'oc_admin2',
  'dbpassword' => '6WM;)>o-GJ7EkAd.xbiuI@6h*J&y:3',
  'installed' => true,
  'objectstore' => [
    'class' => '\\OC\\Files\\ObjectStore\\S3',
    'arguments' => [
            //填写 OSS 的 Bucket 名称
            'bucket' => 'nextcloud',
            'autocreate' => true,
            //填写创建的子账户的 AccessKey ID
            'key'    => 'admin',
            //填写创建的子账户的 AccessKey Secret
            'secret' => '19941108Aa@',
            //填写 OSS 的内网 Endpoint 域名
            'hostname' => '192.168.1.218',
            'port' => 9000,
            'use_ssl' => false,
            'use_path_style'=>false
    ],
],
);


```
