我正在尝试在OpenWRT设备上安装NextCloud; FriendlyElec NanoPi R6 s(非常非常结实的ARM SbC)。所以我安装了MariaDB、PHP和Caddy。它们都运行得很好,除了:PHP无法通过localhost
连接到MariaDB。这会破坏NextCloud的安装程序...
一、错误:
# sudo -u www ./occ maintenance:install --database mysql --database-name nextcloud --database-host localhost --database-port 3306 --database-user root --database-pass '<...>' --admin-user "IngwiePhoenix" --admin-pass '<...>'
The current PHP memory limit is below the recommended value of 512MB.
Error while trying to create admin user: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory
Trace: #0 /sdcard/srv/nextcloud/lib/private/DB/ConnectionAdapter.php(69): OC\DB\Exceptions\DbalException::wrap(Object(Doctrine\DBAL\Exception))
#1 /sdcard/srv/nextcloud/lib/private/DB/MySqlTools.php(59): OC\DB\ConnectionAdapter->executeQuery('SELECT VERSION(...')
#2 /sdcard/srv/nextcloud/lib/private/DB/MySqlTools.php(39): OC\DB\MySqlTools->isMariaDBWithLargePrefix(Object(OC\DB\ConnectionAdapter))
#3 /sdcard/srv/nextcloud/lib/private/Setup/MySQL.php(47): OC\DB\MySqlTools->supports4ByteCharset(Object(OC\DB\ConnectionAdapter))
#4 /sdcard/srv/nextcloud/lib/private/Setup.php(353): OC\Setup\MySQL->setupDatabase('IngwiePhoenix')
#5 /sdcard/srv/nextcloud/core/Command/Maintenance/Install.php(105): OC\Setup->install(Array)
#6 /sdcard/srv/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OC\Core\Command\Maintenance\Install->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /sdcard/srv/nextcloud/3rdparty/symfony/console/Application.php(1009): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /sdcard/srv/nextcloud/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand(Object(OC\Core\Command\Maintenance\Install), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /sdcard/srv/nextcloud/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /sdcard/srv/nextcloud/lib/private/Console/Application.php(213): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /sdcard/srv/nextcloud/console.php(100): OC\Console\Application->run()
#12 /sdcard/srv/nextcloud/occ(11): require_once('/sdcard/srv/nex...')
#13 {main}
Previous: Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory
Trace: #0 /sdcard/srv/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1519): OC\DB\Connection->connect()
#1 /sdcard/srv/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1041): Doctrine\DBAL\Connection->getWrappedConnection()
#2 /sdcard/srv/nextcloud/lib/private/DB/Connection.php(261): Doctrine\DBAL\Connection->executeQuery('SELECT VERSION(...', Array, Array, NULL)
#3 /sdcard/srv/nextcloud/lib/private/DB/ConnectionAdapter.php(66): OC\DB\Connection->executeQuery('SELECT VERSION(...', Array, Array)
#4 /sdcard/srv/nextcloud/lib/private/DB/MySqlTools.php(59): OC\DB\ConnectionAdapter->executeQuery('SELECT VERSION(...')
#5 /sdcard/srv/nextcloud/lib/private/DB/MySqlTools.php(39): OC\DB\MySqlTools->isMariaDBWithLargePrefix(Object(OC\DB\ConnectionAdapter))
#6 /sdcard/srv/nextcloud/lib/private/Setup/MySQL.php(47): OC\DB\MySqlTools->supports4ByteCharset(Object(OC\DB\ConnectionAdapter))
#7 /sdcard/srv/nextcloud/lib/private/Setup.php(353): OC\Setup\MySQL->setupDatabase('IngwiePhoenix')
#8 /sdcard/srv/nextcloud/core/Command/Maintenance/Install.php(105): OC\Setup->install(Array)
#9 /sdcard/srv/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OC\Core\Command\Maintenance\Install->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /sdcard/srv/nextcloud/3rdparty/symfony/console/Application.php(1009): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /sdcard/srv/nextcloud/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand(Object(OC\Core\Command\Maintenance\Install), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /sdcard/srv/nextcloud/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /sdcard/srv/nextcloud/lib/private/Console/Application.php(213): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /sdcard/srv/nextcloud/console.php(100): OC\Console\Application->run()
#15 /sdcard/srv/nextcloud/occ(11): require_once('/sdcard/srv/nex...')
#16 {main}
然后,我的MariaDB配置:
# cat /etc/mysql/conf.d/50-server.cnf | grep bind
bind-address = localhost
并经查证:
# netstat -lntu | grep 3306
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN
tcp 0 0 ::1:3306 :::* LISTEN
MariaDB日志还指示成功启动:
2022-12-11 14:13:03 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-12-11 14:13:03 0 [Note] InnoDB: Number of pools: 1
2022-12-11 14:13:03 0 [Note] InnoDB: Using ARMv8 crc32 + pmull instructions
2022-12-11 14:13:03 0 [Warning] mysqld: io_uring_queue_init() failed with errno 2
2022-12-11 14:13:03 0 [Warning] InnoDB: liburing disabled: falling back to innodb_use_native_aio=OFF
2022-12-11 14:13:03 0 [Note] InnoDB: Initializing buffer pool, total size = 67108864, chunk size = 67108864
2022-12-11 14:13:03 0 [Note] InnoDB: Completed initialization of buffer pool
2022-12-11 14:13:03 0 [Note] InnoDB: 128 rollback segments are active.
2022-12-11 14:13:03 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2022-12-11 14:13:03 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2022-12-11 14:13:03 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2022-12-11 14:13:03 0 [Note] InnoDB: 10.6.10 started; log sequence number 42510; transaction id 14
2022-12-11 14:13:03 0 [Note] InnoDB: Loading buffer pool(s) from /srv/mysql/ib_buffer_pool
2022-12-11 14:13:03 0 [Warning] You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work.
2022-12-11 14:13:03 0 [Note] InnoDB: Buffer pool(s) load completed at 221211 14:13:03
2022-12-11 14:13:03 0 [Note] Server socket created on IP: '::1'.
2022-12-11 14:13:03 0 [Note] Server socket created on IP: '127.0.0.1'.
2022-12-11 14:13:03 0 [Note] /usr/bin/mysqld: ready for connections.
Version: '10.6.10-MariaDB-log' socket: '/var/run/mysql/mysql.sock' port: 3306 Source distribution
==> /var/log/mysql/mysql.log <==
/usr/bin/mysqld, Version: 10.6.10-MariaDB-log (Source distribution). started with:
Tcp port: 3306 Unix socket: (null)
Time Id Command Argument
而且,为了好meassure:
# cat /etc/php.ini | grep mysql
;[mysql]
mysql.default_socket = "/var/run/mysql/mysql.sock"
mysqli.default_socket = "/var/run/mysql/mysql.sock"
mysqlnd.default_socket = "/var/run/mysql/mysql.sock"
所有的都在那里,都是一致的--它应该只是/work/。但是由于这样或那样的原因,NextCloud只是拒绝连接,在挖掘了MariaDB配置和PHP FPM配置之后,我真的没有想法和选择了...
1条答案
按热度按时间plicqrtu1#
很好,我已经很接近了。还有一个位置需要指定默认套接字:
因此,满载为:
希望这最终对某人有帮助。应该涵盖所有情况。之后,NextCloud连接并正确安装:)
注意:确保初始安装时使用的MySQL用户具有
GRANT OPTIONS
。否则,无论如何都将失败。