最近,我尝试在使用Ubuntu Trusty作为基本OS映像的BOSH Lite作业容器中安装mysql-server。
我在作业控制脚本中使用了以下Shell命令集。
DB_PASSWORD=root
DB_USERNAME=root
# set and export environment variables
export DEBIAN_FRONTEND=noninteractive
export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
# set MySQL root password configuration using debconf
echo debconf mysql-server/root_password password ${DB_PASSWORD} | \
sudo debconf-set-selections
echo debconf mysql-server/root_password_again password ${DB_PASSWORD} | \
sudo debconf-set-selections
# run package updates
apt-get update
# install mysql
apt-get -y install mysql-server
但是在安装过程中出现以下错误。
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libdbd-mysql-perl libdbi-perl libhtml-template-perl libmysqlclient18
libterm-readkey-perl mysql-client-5.5 mysql-client-core-5.5 mysql-common
mysql-server-5.5 mysql-server-core-5.5
Suggested packages:
libclone-perl libmldbm-perl libnet-daemon-perl libplrpc-perl
libsql-statement-perl libipc-sharedcache-perl tinyca mailx
The following NEW packages will be installed:
libdbd-mysql-perl libdbi-perl libhtml-template-perl libmysqlclient18
libterm-readkey-perl mysql-client-5.5 mysql-client-core-5.5 mysql-common
mysql-server mysql-server-5.5 mysql-server-core-5.5
0 upgraded, 11 newly installed, 0 to remove and 61 not upgraded.
Need to get 0 B/9,466 kB of archives.
After this operation, 97.1 MB of additional disk space will be used.
Preconfiguring packages ...
Selecting previously unselected package mysql-common.
(Reading database ... 55269 files and directories currently installed.)
Preparing to unpack .../mysql-common_5.5.59-0ubuntu0.14.04.1_all.deb ...
Unpacking mysql-common (5.5.59-0ubuntu0.14.04.1) ...
Selecting previously unselected package libmysqlclient18:amd64.
Preparing to unpack .../libmysqlclient18_5.5.59-0ubuntu0.14.04.1_amd64.deb ...
Unpacking libmysqlclient18:amd64 (5.5.59-0ubuntu0.14.04.1) ...
Selecting previously unselected package libdbi-perl.
Preparing to unpack .../libdbi-perl_1.630-1_amd64.deb ...
Unpacking libdbi-perl (1.630-1) ...
Selecting previously unselected package libdbd-mysql-perl.
Preparing to unpack .../libdbd-mysql-perl_4.025-1ubuntu0.1_amd64.deb ...
Unpacking libdbd-mysql-perl (4.025-1ubuntu0.1) ...
Selecting previously unselected package libterm-readkey-perl.
Preparing to unpack .../libterm-readkey-perl_2.31-1_amd64.deb ...
Unpacking libterm-readkey-perl (2.31-1) ...
Selecting previously unselected package mysql-client-core-5.5.
Preparing to unpack .../mysql-client-core-5.5_5.5.59-0ubuntu0.14.04.1_amd64.deb ...
Unpacking mysql-client-core-5.5 (5.5.59-0ubuntu0.14.04.1) ...
Selecting previously unselected package mysql-client-5.5.
Preparing to unpack .../mysql-client-5.5_5.5.59-0ubuntu0.14.04.1_amd64.deb ...
Unpacking mysql-client-5.5 (5.5.59-0ubuntu0.14.04.1) ...
Selecting previously unselected package mysql-server-core-5.5.
Preparing to unpack .../mysql-server-core-5.5_5.5.59-0ubuntu0.14.04.1_amd64.deb ...
Unpacking mysql-server-core-5.5 (5.5.59-0ubuntu0.14.04.1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up mysql-common (5.5.59-0ubuntu0.14.04.1) ...
(Reading database ... 55625 files and directories currently installed.)
Preparing to unpack .../mysql-server-5.5_5.5.59-0ubuntu0.14.04.1_amd64.deb ...
Unpacking mysql-server-5.5 (5.5.59-0ubuntu0.14.04.1) ...
Selecting previously unselected package libhtml-template-perl.
Preparing to unpack .../libhtml-template-perl_2.95-1_all.deb ...
Unpacking libhtml-template-perl (2.95-1) ...
Selecting previously unselected package mysql-server.
Preparing to unpack .../mysql-server_5.5.59-0ubuntu0.14.04.1_all.deb ...
Unpacking mysql-server (5.5.59-0ubuntu0.14.04.1) ...
Processing triggers for ureadahead (0.100.0-16) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up libmysqlclient18:amd64 (5.5.59-0ubuntu0.14.04.1) ...
Setting up libdbi-perl (1.630-1) ...
Setting up libdbd-mysql-perl (4.025-1ubuntu0.1) ...
Setting up libterm-readkey-perl (2.31-1) ...
Setting up mysql-client-core-5.5 (5.5.59-0ubuntu0.14.04.1) ...
Setting up mysql-client-5.5 (5.5.59-0ubuntu0.14.04.1) ...
Setting up mysql-server-core-5.5 (5.5.59-0ubuntu0.14.04.1) ...
Setting up mysql-server-5.5 (5.5.59-0ubuntu0.14.04.1) ...
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
* Stopping MySQL database server mysqld [ OK ]
180131 10:42:18 [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.
180131 10:42:18 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
180131 10:42:18 [Note] /usr/sbin/mysqld (mysqld 5.5.59-0ubuntu0.14.04.1) starting as process 12602 ...
180131 10:42:18 [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.
180131 10:42:18 [Note] Plugin 'FEDERATED' is disabled.
180131 10:42:18 InnoDB: The InnoDB memory heap is disabled
180131 10:42:18 InnoDB: Mutexes and rw_locks use GCC atomic builtins
180131 10:42:18 InnoDB: Compressed tables use zlib 1.2.8
180131 10:42:18 InnoDB: Using Linux native AIO
/usr/sbin/mysqld: Can't create/write to file '/tmp/ibC0f7nz' (Errcode: 13)
180131 10:42:18 InnoDB: Error: unable to create temporary file; errno: 13
180131 10:42:18 [ERROR] Plugin 'InnoDB' init function returned error.
180131 10:42:18 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
180131 10:42:18 [ERROR] Unknown/unsupported storage engine: InnoDB
180131 10:42:18 [ERROR] Aborting
180131 10:42:18 [Note] /usr/sbin/mysqld: Shutdown complete
Configuring mysql-server-5.5
----------------------------
Unable to set password for the MySQL "root" user
An error occurred while setting the password for the MySQL administrative
user. This may have happened because the account already has a password, or
because of a communication problem with the MySQL server.
You should check the account's password after the package installation.
Please read the /usr/share/doc/mysql-server-5.5/README.Debian file for more
information.
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
* Starting MySQL database server mysqld [fail]
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing package mysql-server-5.5 (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up libhtml-template-perl (2.95-1) ...
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.5; however:
Package mysql-server-5.5 is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.19-0ubuntu6.13) ...
Processing triggers for ureadahead (0.100.0-16) ...
Errors were encountered while processing:
mysql-server-5.5
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
我无法找出解决方案。
如何解决此问题?
最佳答案
而不是自己动手,为什么不使用Pivotal创建并包含在CloudFoundry中的代码呢?
https://bosh.io/releases/github.com/cloudfoundry/cf-mysql-release?all=1