2016-06-19 15 views
1

chrootされた環境で古いAndroidの携帯電話に低トラフィックのWebサーバーを設定しようとしています。 Debianは電話にインストールされ、数ヶ月間正しく動作します(これは特別なLinux環境の一種です)。MySQLは起動しません:[ERROR] IPv4用のソケットを作成できませんでした: '127.0.0.1':errno:13

Apache2とPythonが起動しています。

しかし、私はmysqldの起動:は/ var/runのでは

#skip-networking 
... 
socket   = /var/run/mysqld/mysqld.sock 

:/etc/mysql/my.confで

[email protected]:~# /usr/sbin/mysqld 
... [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead. 
... [Note] /usr/sbin/mysqld (mysqld 5.5.49-0+deb7u1) starting as process 31419 ... 
... [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead. 
... [Note] Plugin 'FEDERATED' is disabled. 
... InnoDB: The InnoDB memory heap is disabled 
... InnoDB: Mutexes and rw_locks use GCC atomic builtins 
... InnoDB: Compressed tables use zlib 1.2.7 
... InnoDB: Using Linux native AIO 
... InnoDB: Initializing buffer pool, size = 128.0M 
... InnoDB: Completed initialization of buffer pool 
... InnoDB: highest supported file format is Barracuda. 
... InnoDB: Waiting for the background threads to start 
... InnoDB: 5.5.49 started; log sequence number 1598476 
... [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306 
... [Note] - '127.0.0.1' resolves to '127.0.0.1'; 
... [ERROR] Failed to create a socket for IPv4 '127.0.0.1': errno: 13. 
... [ERROR] Can't create IP socket: Permission denied 
... [ERROR] Aborting 
... InnoDB: Starting shutdown... 
... InnoDB: Shutdown completed; log sequence number 1598476 
... [Note] /usr/sbin/mysqld: Shutdown complete 

drwxrwxrwx 2 MySQLのMySQLの4096 jún19 10:07 mysqld

したがって、理論上ソケットは書かれている。

(私はスキップネットワーキング MySQLの開始を可能にするが、私はpymysql.connectを経由してのpythonから、それに接続できない場合)

/etc /グループが不完全であると思われると私はグループを見たことは注目に値します(ディレクトリリストにある)IDだけの名前を持たないので、ある種のmysqlがそのグループに属していないということは、ネットワークリソース型の問題が考えられます。

プログラムを使用している他のネットワークには、apache2の作業が含まれます。

PS skip-networkingを有効にしてPythonを有効にすると回避策になるはずです。

答えて

2

あなたのAndroidカーネルがCONFIG_ANDROID_PARANOID_NETWORKでコンパイルされている可能性があります。 mysqlユーザーをaid_inetグループとaid_net_rawグループに追加することで修正できます。後

[[email protected] ~]$ mysqld 
2017-04-16 8:25:07 4143896512 [Note] mysqld (mysqld 10.1.22-MariaDB) starting as process 6995 ... 
2017-04-16 8:25:08 4143896512 [Note] InnoDB: Using mutexes to ref count buffer pool pages 
2017-04-16 8:25:08 4143896512 [Note] InnoDB: The InnoDB memory heap is disabled 
2017-04-16 8:25:08 4143896512 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 
2017-04-16 8:25:08 4143896512 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier 
2017-04-16 8:25:08 4143896512 [Note] InnoDB: Compressed tables use zlib 1.2.11 
2017-04-16 8:25:08 4143896512 [Note] InnoDB: Using Linux native AIO 
2017-04-16 8:25:08 4143896512 [Note] InnoDB: Using generic crc32 instructions 
2017-04-16 8:25:08 4143896512 [Note] InnoDB: Initializing buffer pool, size = 128.0M 
2017-04-16 8:25:08 4143896512 [Note] InnoDB: Completed initialization of buffer pool 
2017-04-16 8:25:08 4143896512 [Note] InnoDB: Highest supported file format is Barracuda. 
2017-04-16 8:25:08 4143896512 [Note] InnoDB: 128 rollback segment(s) are active. 
2017-04-16 8:25:08 4143896512 [Note] InnoDB: Waiting for purge to start 
2017-04-16 8:25:08 4143896512 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.35-80.0 started; log sequence number 1616819 
2017-04-16 8:25:08 4143896512 [Note] Plugin 'FEEDBACK' is disabled. 
2017-04-16 8:25:08 3630140224 [Note] InnoDB: Dumping buffer pool(s) not yet started 
2017-04-16 8:25:08 4143896512 [Warning] Failed to create a socket for IPv6 '::': errno: 13. 
2017-04-16 8:25:08 4143896512 [Warning] Failed to create a socket for IPv4 '0.0.0.0': errno: 13. 
2017-04-16 8:25:08 4143896512 [ERROR] Can't create IP socket: Permission denied 
2017-04-16 8:25:08 4143896512 [ERROR] Aborting 

::前

[[email protected] mysqld]# usermod -a -G aid_inet,aid_net_raw mysql 
[[email protected] mysqld]# su mysql 
[[email protected] mysqld]$ mysqld 
2017-04-16 9:56:00 4144179136 [Note] mysqld (mysqld 10.1.22-MariaDB) starting as process 7246 ... 
2017-04-16 9:56:00 4144179136 [Note] InnoDB: Using mutexes to ref count buffer pool pages 
2017-04-16 9:56:00 4144179136 [Note] InnoDB: The InnoDB memory heap is disabled 
2017-04-16 9:56:00 4144179136 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 
2017-04-16 9:56:00 4144179136 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier 
2017-04-16 9:56:00 4144179136 [Note] InnoDB: Compressed tables use zlib 1.2.11 
2017-04-16 9:56:00 4144179136 [Note] InnoDB: Using Linux native AIO 
2017-04-16 9:56:00 4144179136 [Note] InnoDB: Using generic crc32 instructions 
2017-04-16 9:56:00 4144179136 [Note] InnoDB: Initializing buffer pool, size = 128.0M 
2017-04-16 9:56:00 4144179136 [Note] InnoDB: Completed initialization of buffer pool 
2017-04-16 9:56:00 4144179136 [Note] InnoDB: Highest supported file format is Barracuda. 
2017-04-16 9:56:00 4144179136 [Note] InnoDB: 128 rollback segment(s) are active. 
2017-04-16 9:56:00 4144179136 [Note] InnoDB: Waiting for purge to start 
2017-04-16 9:56:00 4144179136 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.35-80.0 started; log sequence number 1616869 
2017-04-16 9:56:00 4144179136 [Note] Plugin 'FEEDBACK' is disabled. 
2017-04-16 9:56:00 3632237376 [Note] InnoDB: Dumping buffer pool(s) not yet started 
2017-04-16 9:56:00 4144179136 [Note] Server socket created on IP: '::'. 
2017-04-16 9:56:00 4144179136 [Note] mysqld: ready for connections. 
Version: '10.1.22-MariaDB' socket: '/run/mysqld/mysqld.sock' port: 3306 MariaDB Server 

はまたhttps://stackoverflow.com/a/36451445/4158804

mysql Ver 15.1 Distrib 10.1.22-MariaDB, for Linux (i686)とArchlinux chrootにLinux 81fc75b0d254466b 4.4.40-android-x86_64 #2 SMP PREEMPT Fri Jan 13 22:40:54 CST 2017 x86_64 GNU/Linuxでテスト参照してください。

+0

うわー、私のために働いた。それは、たとえaid_net_rawグループが存在しなくてもうまく機能していることに注意してください。手動でリンクを追加する必要がありました。 –

関連する問題