Docker can't start MariaDB/MySQL during Docker build - mysql

My current Dockerfile looks like this:
FROM ubuntu:14.04
ENV DEBIAN_FRONTEND noninteractive
ENV INITRD No
ENV LANG en_US.UTF-8
# Maria DB Versions
ENV MARIADB_MAJOR 5.5
ENV MARIADB_VERSION 5.5.55+maria-1~trusty
# Create mysql user and group
RUN groupadd -r mysql && useradd -r -g mysql mysql
# Install needed dependencies
RUN apt-get update && apt-get install -y --no-install-recommends software-properties-common && rm -rf /var/lib/apt/lists/*
# Add the MariaDB PGP key to verify their Debian packages.
RUN apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
# Add MariaDB's repository. We use the Ubuntu 14.04 version as there ain't no MariaDB 5.5 for Ubuntu 16.04.
RUN add-apt-repository 'deb http://mirror.jmu.edu/pub/mariadb/repo/5.5/ubuntu trusty main'
# Install Maria DB and open the access for outside of the container
RUN apt-get update \
&& apt-get install -y --no-install-recommends mariadb-server=$MARIADB_VERSION \
&& rm -rf /var/lib/apt/lists/* \
&& sed -i 's/^\(bind-address\s.*\)/# \1/' /etc/mysql/my.cnf \
&& update-rc.d -f mysql disable
# Run as user mysql
USER mysql
# Start the MariaDB to add a user and create the DB
RUN mysqld
RUN echo "#TODO: Create DB, User and grant access"
# Expose Port
EXPOSE 3306
When building the container using docker build -t testmariadb . I get the following output:
Step 13/17 : RUN mysqld
---> Running in 5aeb49c81f5e
170428 20:00:25 [Note] mysqld (mysqld 5.5.55-MariaDB-1~trusty) starting as process 7 ...
170428 20:00:25 InnoDB: The InnoDB memory heap is disabled
170428 20:00:25 InnoDB: Mutexes and rw_locks use GCC atomic builtins
170428 20:00:25 InnoDB: Compressed tables use zlib 1.2.8
170428 20:00:25 InnoDB: Using Linux native AIO
170428 20:00:25 InnoDB: Initializing buffer pool, size = 256.0M
170428 20:00:25 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
170428 20:00:25 InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
170428 20:00:25 InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
170428 20:00:25 InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: 127 rollback segment(s) active.
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
170428 20:00:25 InnoDB: Waiting for the background threads to start
170428 20:00:26 Percona XtraDB (http://www.percona.com) 5.5.52-MariaDB-38.3 started; log sequence number 0
170428 20:00:26 [Note] Plugin 'FEEDBACK' is disabled.
170428 20:00:26 [Note] Server socket created on IP: '0.0.0.0'.
170428 20:00:26 [Note] Event Scheduler: Loaded 0 events
170428 20:00:26 [Note] mysqld: ready for connections.
Version: '5.5.55-MariaDB-1~trusty' socket: '/var/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution
As far as I can tell, it starts the MariaDB, but then is stuck there and doesn't execute a next command. Is there another way to start MariaDB in docker?

1)It is not stuck. The MariaDB start running. But you need to use CMD command and not RUN command to achieve your purpose.
The command CMD, similarly to RUN, can be used for executing a specific command. However, unlike RUN it is not executed during build, but when a container is instantiated using the image being built.
2) The last part of your dockerfile should look like this
#Run as user mysql
USER mysql
RUN echo "#TODO: Create DB, User and grant access"
#Expose Port
EXPOSE 3306
#Right way to run mysqld
CMD ["mysqld"]
For building your image
docker build -t testmariadb .
For running the built image
docker run testmariadb
OR ( for detached mode )
docker run -d testmariadb
3) Please ask your self why are you using ubuntu base image (FROM ubuntu:14.04). According to me you should use https://hub.docker.com/_/mariadb/ if you just want to run mariaDb in the container.

For running container what docker command you are using?
Please follow official Docker file for MariaDB.
Docker MariaDB
Here is latest DockerFile MariaDB

this is wrong
# Start the MariaDB to add a user and create the DB
RUN mysqld
I guess you wanted
CMD mysqld
or such
see from
https://github.com/docker-library/mysql/blob/7a850980c4b0d5fb5553986d280ebfb43230a6bb/8.0/Dockerfile
the end is
EXPOSE 3306
CMD ["mysqld"]
RUN, WORKDIR, ADD, COPY, ENV (and some others) helps you for configuring your docker image, ENTRYPOINT and CMD for starting your software (nginx for a nginx image, Wordpress...)
The doc
https://docs.docker.com/engine/reference/builder/

Related

Mysql will not restart

I'm trying to start the mysql server using the command
sudo /etc/init.d/mysql start
but it won't start. I don't get a specific error all I see is
* Starting MySQL database server mysqld [fail]
i've tried the same command but using restart instead but same results. I've also tried to start it using
sudo service start mysql
I am stuck at this point. please let me know if I can provide anymore information.
Thank you.
Here is my mysql error.log
150505 21:43:49 [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.
150505 21:43:49 [Note] Plugin 'FEDERATED' is disabled.
150505 21:43:49 InnoDB: The InnoDB memory heap is disabled
150505 21:43:49 InnoDB: Mutexes and rw_locks use GCC atomic builtins
150505 21:43:49 InnoDB: Compressed tables use zlib 1.2.8
150505 21:43:49 InnoDB: Using Linux native AIO
150505 21:43:49 InnoDB: Initializing buffer pool, size = 128.0M
150505 21:43:49 InnoDB: Completed initialization of buffer pool
150505 21:43:49 InnoDB: highest supported file format is Barracuda.
InnoDB: Log scan progressed past the checkpoint lsn 30152041
150505 21:43:49 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Doing recovery: scanned up to log sequence number 30161741
I know this question was posted long back. But I have figured out a solution since I had the same problem. This error might occurs due to multiple installations of MySQL, in the operating system.
sudo ps -A|grep mysql
Kill the process of mysql
sudo pkill mysql
Then run the command
sudo ps -A|grep mysqld
kill process of mysqld
sudo pkill mysqld
Now you can safely restart MySQL server
sudo service mysql restart
mysql -u root -p
Hope this helps
sudo /etc/init.d/mysql start this should work.
Or else
restart server using sudo /etc/init.d/mysql restart
Still down.
run service mysql status and check script name(this will be sometimes mysqld).
then
service mysqld status
service mysqld stop
service mysqld start

InnoDB: Operating system error number 13 in a file operation not fixed after changing permissions in /var/lib/mysql/ or disabling selinux

When I run mysql, I get the error of ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2). mysqld gives the error of
150101 12:08:19 [Warning] Can't create test file /var/lib/mysql/lamp-update.lower-test
150101 12:08:19 [Warning] Can't create test file /var/lib/mysql/lamp-update.lower-test
150101 12:08:19 [Warning] One can only use the --user switch if running as root
150101 12:08:19 [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.
150101 12:08:19 [Note] Plugin 'FEDERATED' is disabled.
mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
150101 12:08:19 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
150101 12:08:19 InnoDB: The InnoDB memory heap is disabled
150101 12:08:19 InnoDB: Mutexes and rw_locks use GCC atomic builtins
150101 12:08:19 InnoDB: Compressed tables use zlib 1.2.8
150101 12:08:19 InnoDB: Using Linux native AIO
150101 12:08:19 InnoDB: Initializing buffer pool, size = 128.0M
150101 12:08:19 InnoDB: Completed initialization of buffer pool
150101 12:08:19 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation.
sudo mysqld gives the output of 150101 12:11:59 [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.
I am running a virtual ubuntu linux server. Mysql has worked without a problem until yesterday, when I got this error.
I have tried to set the permissions of the files in /var/lib/mysql to 660, /var/lib/mysql to 755, and its subdirectories to 700. I then ran sudo chown -R mysql:mysql /var/lib/mysql. Then, I tried rebooting my server, and running mysqld. I got the same error.
Then, I tried disabling selinux by running sudo vim /etc/selinux/semanage.conf and adding SELINUX=disabled to the file as the first line. I rebooted again, and got the same error.
This is the extent of any advice I have seen on stackexchange or other sites.
Does anyone have any ideas for what I could do?
Thank you,
Daniel
Edit:
I "solved" my problem by running mysqld as root, but this doesn't seem like a good idea security wise, so I am still looking for a better solution.
I could solve this by changing the ownership of the folder to mysql from group root (sudo chown -R mysql:root folder). Once I did this, all started to work again.
Regards
In my case SELinux was enabled and by disabling SELinux i was able to start the service
To disable SELlinux, edit
/etc/sysconfig/selinux
and set
SELINUX=disabled
Reboot and verify with command
sestatus
Folder permissions in my case are
chown -R mysql:mysql /mnt/efs/fs1/mysql
chmod -R 750 /mnt/efs/fs1/mysql
where /mnt/efs/fs1/mysql is my data directory
I also troubled with this problem.I used 'setenforce 0' this command and then mysql service successfully start.Maybe you can try it.Good luck
first, type these command below;
chown -R root:mysql /opt/lampp/var/mysql
chown -R root:mysql /opt/lampp/mysql
chmod -R 777 /opt/lampp/var/mysql
chmod -R 777 /opt/lampp/mysql
second, rerun the installer.
it worked for me.

MariaDB 10 CentOS 7 moving datadir woes

Brand new "minimal" install of CentOS 7 along with MariaDB 10. I have an additional mounted mirrored volume that I want to use for the datadir. Startup sequence is fine and completes normally when my.cnf [mysqld] is commented out. I've copied the data..
sudo cp -R -p /var/lib/mysql/* /mnt/mysql/
The permissions are identical to those of the original. The volume is in /etc/fstab and mounts fine
/dev/sdb1 /mnt/mysql xfs defaults 0 0
[root#femur mysql]# ls -la
total 110632
drwxr-xr-x. 5 mysql mysql 4096 Oct 20 15:27 .
drwxr-xr-x. 3 root root 18 Oct 16 16:46 ..
-rw-rw----. 1 mysql mysql 16384 Oct 20 15:27 aria_log.00000001
-rw-rw----. 1 mysql mysql 52 Oct 20 15:27 aria_log_control
-rw-r-----. 1 mysql root 7005 Oct 20 13:49 femur.err
-rw-rw----. 1 mysql mysql 12582912 Oct 20 15:27 ibdata1
-rw-rw----. 1 mysql mysql 50331648 Oct 20 15:27 ib_logfile0
-rw-rw----. 1 mysql mysql 50331648 Oct 20 12:21 ib_logfile1
-rw-rw----. 1 mysql mysql 0 Oct 20 12:22 multi-master.info
drwx--x--x. 2 mysql mysql 4096 Oct 20 12:21 mysql
drwx------. 2 mysql mysql 4096 Oct 20 13:37 performance_schema
drwxr-xr-x. 2 mysql mysql 6 Oct 20 12:21 test
this is in my.cnf
!includedir /etc/my.cnf.d
[mysqld]
log_error = /var/log/mysql-error.log
user = mysql
datadir = /mnt/mysql
socket = /mnt/mysql/mysql.sock
This is what I get when I try to start it...
'[root#femur mysql]# sudo systemctl start mysql.service
Job for mysql.service failed. See 'systemctl status mysql.service' and 'journalctl -xn' for details.'
Neither of those two files says much, but this is in /var/log/mysql-error.log
141020 16:07:09 mysqld_safe Starting mysqld daemon with databases from /mnt/mysql
141020 16:07:09 [Warning] Can't create test file /mnt/mysql/femur.lower-test
141020 16:07:09 [Note] InnoDB: Using mutexes to ref count buffer pool pages
141020 16:07:09 [Note] InnoDB: The InnoDB memory heap is disabled
141020 16:07:09 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
141020 16:07:09 [Note] InnoDB: Memory barrier is not used
141020 16:07:09 [Note] InnoDB: Compressed tables use zlib 1.2.7
141020 16:07:09 [Note] InnoDB: Using Linux native AIO
141020 16:07:09 [Note] InnoDB: Using CPU crc32 instructions
141020 16:07:09 [Note] InnoDB: Initializing buffer pool, size = 128.0M
141020 16:07:09 [Note] InnoDB: Completed initialization of buffer pool
2014-10-20 16:07:09 7f6cb59c9880 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
141020 16:07:09 [ERROR] InnoDB: os_file_get_status() failed on './ibdata1'. Can't determine file permissions
141020 16:07:09 [ERROR] InnoDB: The system tablespace must be writable!
141020 16:07:09 [ERROR] Plugin 'InnoDB' init function returned error.
141020 16:07:09 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
141020 16:07:09 [ERROR] mysqld: File '/mnt/mysql/aria_log_control' not found (Errcode: 13 "Permission denied")
141020 16:07:09 [ERROR] mysqld: Got error 'Can't open file' when trying to use aria control file '/mnt/mysql/aria_log_control'
141020 16:07:09 [ERROR] Plugin 'Aria' init function returned error.
141020 16:07:09 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
141020 16:07:09 [Note] Plugin 'FEEDBACK' is disabled.
141020 16:07:09 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
141020 16:07:09 [ERROR] Unknown/unsupported storage engine: InnoDB
141020 16:07:09 [ERROR] Aborting
141020 16:07:09 [Note] /usr/sbin/mysqld: Shutdown complete
141020 16:07:09 mysqld_safe mysqld from pid file /mnt/mysql/femur.pid ended
http://www.reddit.com/r/linuxadmin/comments/2ebhpf/adventures_in_moving_mariadb_data_folder/ helped a bit, but I wasn't able to get it to work.
Any help would be greatly appreciated.
The issue is indeed SELinux; you need to do three things before MariaDB / MySQL will start on CentOS 7:
Ensure the user:group is mysql:mysql
Set the SELinux tag to mysqld_db_t
Set the SELinux user to system_u
This is as simple as:
chcon -Rt mysqld_db_t /database/db
chcon -Ru system_u /database/db
chown -R mysql:mysql /database/db
The whole thing I needed to do after plugging in a disk is below:
cfdisk /dev/sdb
pvcreate /dev/sdb1
vgcreate database /dev/sdb1
lvcreate -l 100%FREE -n db database
mkfs.ext4 /dev/database/db
mkdir /database
mount /database
mkdir /database/db
chcon -Rt mysqld_db_t /database/db
chcon -Ru system_u /database/db
chown -R mysql:mysql /database/db
systemctl start mariadb
Well that was interesting...
It turns out, that CentOS 7 "minimal" installs SELinux, which apparently was preventing mysql from writing to the mounted mirrored set. I was looking for security items that I might not have thought about and found it right there in the docs. I had previously thought (obviously erroneously) that SELinux was a distribution, not a module. Once I ran the test to see if it was there....
getenforce
I temporarily disabled it to test.
setenforce 0
Finally, I was able to start MariaDB with the directory in the mirrored set as the datadir and no errors. To make this change permanent (because this server is behind a firewall), in /etc/selinux/config, I made
- SELINUX=enforcing
+ SELINUX=disabled
I hope this helps someone else. Have a great day!
I found this step by step guide working for me: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/SELinux_Users_and_Administrators_Guide/sect-Managing_Confined_Services-MariaDB-Configuration_Examples.html
You must install:
yum install policycoreutils-python
Guide:
View the SELinux context of the default database location for mysql:
~]# ls -lZ /var/lib/mysql
drwx------. mysql mysql system_u:object_r:mysqld_db_t:s0 mysql
This shows mysqld_db_t which is the default context element for the location of database files. This context will have to be manually applied to the new database location that will be used in this example in order for it to function properly.
Stop the mysqld daemon:
~]# systemctl stop mariadb.service
Create a new directory for the new location of the database(s). In this example, /mysql/ is used:
~]# mkdir -p /mysql
Copy the database files from the old location to the new location:
~]# cp -R /var/lib/mysql/* /mysql/
Change the ownership of this location to allow access by the mysql user and group. This sets the traditional Unix permissions which SELinux will still observe:
~]# chown -R mysql:mysql /mysql
Run the following command to see the initial context of the new directory:
~]# ls -lZ /mysql
drwxr-xr-x. mysql mysql unconfined_u:object_r:usr_t:s0 mysql
The context usr_t of this newly created directory is not currently suitable to SELinux as a location for MariaDB database files. Once the context has been changed, MariaDB will be able to function properly in this area.
Open the main MariaDB configuration file /etc/my.cnf with a text editor and modify the datadir option so that it refers to the new location. In this example the value that should be entered is /mysql:
[mysqld]
datadir=/mysql
Save this file and exit.
Start mysqld. The service should fail to start, and a denial message will be logged to the /var/log/messages file:
~]# systemctl start mariadb.service
Job for mariadb.service failed. See 'systemctl status postgresql.service' and 'journalctl -xn' for details.
However, if the audit daemon is running and with him the setroubleshoot service, the denial will be logged to the /var/log/audit/audit.log file instead:
SELinux is preventing /usr/libexec/mysqld "write" access on /mysql. For complete SELinux messages. run sealert -l b3f01aff-7fa6-4ebe-ad46-abaef6f8ad71
The reason for this denial is that /mysql/ is not labeled correctly for MariaDB data files. SELinux is stopping MariaDB from having access to the content labeled as usr_t. Perform the following steps to resolve this problem:
Run the following command to add a context mapping for /mysql/. Note that the semanageutility is not installed by default. If it missing on your system, install the policycoreutils-pythonpackage.
**~]# semanage fcontext -a -t mysqld_db_t "/mysql(/.*)?"**
This mapping is written to the /etc/selinux/targeted/contexts/files/file_contexts.local file:
~]# grep -i mysql /etc/selinux/targeted/contexts/files/file_contexts.local
/mysql(/.*)? system_u:object_r:mysqld_db_t:s0
Now use the restorecon utility to apply this context mapping to the running system:
**~]# restorecon -R -v /mysql**
Now that the /mysql/ location has been labeled with the correct context for MariaDB, mysqldstarts:
~]# systemctl start mariadb.service
Confirm the context has changed for /mysql/:
~]$ ls -lZ /mysql
drwxr-xr-x. mysql mysql system_u:object_r:mysqld_db_t:s0 mysql
The location has been changed and labeled, and mysqld has started successfully. At this point all running services should be tested to confirm normal operation.

Running MySQL in a Docker container

So my ultimate end goal is to run a MySQL Docker container (say tutum/mysql from the public registry) and then link a Gitlab Docker container (say sameersbn/gitlab) to it where both containers use persistent storage.
However, I am stuck on the MySQL part. Every time I try and run a pre-made MySQL Docker container (mysql, tutum/mysql and sameersbn/mysql) as outlined below, I get the below output.
Steps
This is just one way of getting to the error message below.
docker.io pull tutum/mysql:latest
docker.io run -it tutum/mysql bash
Once attached to the new container run "/run.sh" (as per tutum/mysql dockerfile)
At this point a "Waiting for confirmation of MySQL service startup" message constantly repeats.
At this point if I cancel the "/run.sh" command and start MySQL myself I get the error message below.
Output:
root#1bbeb34f3491:/# mysqld
140730 4:49:04 [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.
140730 4:49:04 [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.
140730 4:49:04 [Note] Plugin 'FEDERATED' is disabled.
mysqld: Table 'mysql.plugin' doesn't exist
140730 4:49:04 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
140730 4:49:04 InnoDB: The InnoDB memory heap is disabled
140730 4:49:04 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140730 4:49:04 InnoDB: Compressed tables use zlib 1.2.8
140730 4:49:04 InnoDB: Using Linux native AIO
140730 4:49:04 InnoDB: Initializing buffer pool, size = 128.0M
140730 4:49:04 InnoDB: Completed initialization of buffer pool
140730 4:49:04 InnoDB: highest supported file format is Barracuda.
140730 4:49:04 InnoDB: Waiting for the background threads to start
140730 4:49:05 InnoDB: 5.5.37 started; log sequence number 1595675
140730 4:49:05 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
140730 4:49:05 [Note] - '0.0.0.0' resolves to '0.0.0.0';
140730 4:49:05 [Note] Server socket created on IP: '0.0.0.0'.
140730 4:49:05 [ERROR] Can't start server : Bind on unix socket: Permission denied
140730 4:49:05 [ERROR] Do you already have another mysqld server running on socket: /var/run/mysqld/mysqld.sock ?
140730 4:49:05 [ERROR] Aborting
140730 4:49:05 InnoDB: Starting shutdown...
140730 4:49:06 InnoDB: Shutdown completed; log sequence number 1595675
140730 4:49:06 [Note] mysqld: Shutdown complete
Addressing the errors
"Please run mysql_upgrade to create it" => run mysql_upgrade command which outputs
root#1bbeb34f3491:/# mysql_upgrade
Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
FATAL ERROR: Upgrade failed
"Do you already have another mysqld server running on socket" => Nope. Running service mysql stop does nothing and running ps doesn't show mysqld. Running ls -a /var/run/mysqld/ suggests that the socket file doesn't exist.
No matter which MySQL container I try, eventually when I start MySQL the same error message came up. This almost certainly means there is something wrong with my setup which confuses me because I thought a Docker container, with no exposed ports or persistent storage, would be isolated from the system Docker is installed on?
I have also tried running a MySQL container with the -d flag then running a fresh ubuntu 14.04 container (docker.io run -it --link mysql:mysql ubuntu:14.04 bash) linked to it. On the Ubuntu container I installed mysql-client through apt-get and tried to connect to the MySQL container on the ip address in MYSQL_PORT_3306_TCP_ADDR but that doesn't work either.
Equally the problem might be that I do not understand how Docker works. If this is the case, can someone create a set of steps that uses one of the MySQL containers on the Docker index and then link a container to it that can connect. This will also help to see whether there is something wrong with my Docker installation (or some other unknown problem that is causing this issue).
My host system is running Ubuntu 14.04 and Docker was installed through apt-get and is version 0.9.1.
I wasn't quite sure what to put in this explanation because the problem seems quite weird to me. If there is anything I have missed please ask and I will add it for you.
Thanks,
JamesStewy
This works for me:
docker run -d -p 3306:3306 -e MYSQL_PASS="mypass" tutum/mysql
No need to run the script from bash, no need for anything clever.

bash:scripts/mysql_install_db: No such file or directory

I am installing mysql-5.5.13.tar.gz in debian 6.0.4. I am following the steps from here
When I run the step
scripts/mysql_install_db --user=mysql I get the exception that
bash: scripts/mysql_install_db: No such file or directory
But file exist in the place. I made that executable too but its not working. I was working in the root terminal. Please help me to resolve this problem.
Thanks
I installed mysql-5.5.24-linux2.6-i686.tar.gz Now after executing command root#server06:/usr/local/mysql# scripts/mysql_install_db --user=mysql I got the message Installing MySQL system tables...
./bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
Installation of system tables failed! Examine the logs in
./data for more information.
You can try to start the mysqld daemon with:
shell> ./bin/mysqld --skip-grant &
and use the command line tool ./bin/mysql
to connect to the mysql database and look at the grant tables:
shell> ./bin/mysql -u root mysql
mysql> show tables
Try 'mysqld --help' if you have problems with paths. Using --log
gives you a log in ./data that may be helpful.
Please consult the MySQL manual section
'Problems running mysql_install_db', and the manual section that
describes problems on your OS. Another information source are the
MySQL email archives available at http://lists.mysql.com/.
Please check all of the above before mailing us! And remember, if
you do mail us, you MUST use the ./bin/mysqlbug script!
and mysql is not started. Please help me should I download another one?
I installed "libaio" using apt-get then it was successfully installed. but when i started mysql using commandbin/mysqld_safe --user=mysql & I got the message
root#server06:/usr/local/mysql# bin/mysqld_safe --user=mysql
120514 16:10:11 mysqld_safe Logging to '/var/lib/mysql/server06.err'.
120514 16:10:11 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
120514 16:10:13 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
In the /var/lib/mysql/server06.err file I found following
20514 16:15:49 [Note]
120514 16:15:49 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
120514 16:17:57 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
120514 16:17:57 [ERROR] Can't find messagefile '/usr/share/mysql/english/errmsg.sys'
120514 16:17:57 [Note] Plugin 'FEDERATED' is disabled.
120514 16:17:57 InnoDB: The InnoDB memory heap is disabled
120514 16:17:57 InnoDB: Mutexes and rw_locks use InnoDB's own implementation
120514 16:17:57 InnoDB: Compressed tables use zlib 1.2.3
120514 16:17:57 InnoDB: Using Linux native AIO
120514 16:17:57 InnoDB: Initializing buffer pool, size = 128.0M
120514 16:17:57 InnoDB: Completed initialization of buffer pool
120514 16:17:57 InnoDB: highest supported file format is Barracuda.
120514 16:17:57 InnoDB: Waiting for the background threads to start
120514 16:17:58 InnoDB: 1.1.8 started; log sequence number 1595675
120514 16:17:58 [ERROR] Aborting
120514 16:17:58 InnoDB: Starting shutdown...
120514 16:17:59 InnoDB: Shutdown completed; log sequence number 1595675
120514 16:17:59 [Note]
120514 16:17:59 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
I searched a lot about this but could not get the solution. Any help will be apprisiated
Thanks
You need to install libaio-dev
Instructions for Debian-based distributions:
sudo apt-get install libaio-dev
By the archive file name mysql-5.5.13.tar.gz I am guessing that you have probably downloaded the source code version of MySQL database. That's why the install procedure doesn't work. To follow the instruction you need an archive containing the binary version, which should have the filename more like mysql-5.5.24-linux2.6-x86_64.tar.gz or mysql-5.5.24-linux2.6-i686.tar.gz (depending on the architecture).
Another way to recognize whether you have the correct archive or not is looking into the extracted directory. A source code version will have a lot of files and directories in it including such as INSTALL-SOURCE, configure, Makefile.am, sql, mysys, unittest, etc. A binary version carries directories like bin, sbin, libexec, etc.
do
cd scripts
./mysql_install_db.sh
paste errors if there are any