mysql in docker container can't start - mysql

This started today and I couldn't figure it out.
Mysql docker container logs reveal this but I have no idea where to fix it and why it started all of a sudden.
Any idea?
2021-05-04T16:32:44.941492Z 0 [ERROR] unknown option '--root#cc1dd09ee7b4:/etc/mysql'

i started a new docker/mysql container and copied data directory from the old one , which "solved" the problem.

Related

Permissions for external HDD nextcloud container

good day.
im trying to migrate my NC19 server to a container.
so far i can install the container and map a persistent drive to the host’s drive but when i try to use an external HDD i get the following erros on the log:
**Initializing nextcloud 19.0.2.2
rsync: chown “/var/www/html/data” failed: Operation not permitted (1)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1207) [sender=3.1.3]**
this is more than likely a permissions issue, but when mounting the HDD as root and granting access to the external drive /media/ncd as root:root or as www-data:www-data i get the above error.
now, the external hdd file system is exfat (not sure if this will affect on the container).
any ideas how can i get past this?
im close to format my hdd as ext4 to see if this fixes it.
thanks in advance
just got this fixed by changing the filesystem from ExFat to ext4

-bash: mysql: command not found

I have looked around at other questions that have been posed and they seem to all have the same answer however my issue seems to be unique.
I have installed MySQL to use in an Angular project and have been trying to run mysql -u root -p in order to get things moving but it throws back -bash: mysql: command not found even though I have also done export PATH=${PATH}:/usr/local/mysql/bin inside of my bash_profile.
This seems to be where it ends for a lot of troubleshooting but it seems I have something else wrong. I have tried adjusting the bash profile to where it is just export PATH=${PATH}:/usr/local/mysql just to see if it would work and there wasn't any difference so I changed it back.
My next thought it uninstalling MySQL and reinstalling but I wanted to see if there was a command I am missing.
Thanks for the help!
Turns out all I needed to do was source ~/.bash_profile so it would reload my profile environment.

Could not find MySQL Connector in Netbeans

I transferred my web project from another laptop to another. Installed every jar files needed. But when i run the project, this error comes out.
C:\Users\user\Desktop\Inventory\Inventory\nbproject\build-impl.xml:1013:
Warning: Could not find file G:\Downloads
from Chrome\commons-fileupload-1.4-src.zip to copy.
BUILD FAILED (total time: 0 seconds)
Ive tried :
Could not find file mysql-connector-java-5.1.13-bin.jar
I have mysql connector installed on my libraries. So i tried Saumil answer. But i could not find the line in my build-impl.xml which is this:
copyfiles files="${file.reference.org-netbeans-modules-db-mysql.jar}"
todir="${build.web.dir}/WEB-INF/lib"
So since i couldn't find the line that Saumil suggested in my build-impl.xml, i have no idea how to fix this. I am not sure which line should i remove to fix this.
Fixed. All i did was clicking the blue link on the error line, and remove all "copyfiles files" line and rerun the project. Thanks :D

Links between service Rancher Server 1.0.0

I'm porting my docker environment to rancher server 1.0.0.
I have a wordpress container which is linked to a mysql container.
Each one are in separate stack: One stack for the wordpress container and one for the mysql container.
Previously, linking between those two container was achieve using a docker-compose.yml for my wordpress container containing:
wordpress:
external_links:
- mysql:mysql
This was working perfectly before, but not anymore when those containers are within a rancher server.
The documentation about DNS service is not clear for me:
http://docs.rancher.com/rancher/rancher-services/internal-dns-service/
In rancher, my stack is named mysql and my service mysql.
I have tried to link using what
wordpress:
external_links:
- mysql.mysql:mysql
But this does not works too.
Those two containers are in a custom catalog, the only way right now to make this work is to create and start the two services and then change linking by upgrading the wordpress service afterward.
Any idea ?
I'm i missing something ?
Thanks a lots !
Here is the solution:
Instead of:
external_links:
- mysql.mysql:mysql
Use the following syntax for linking service within a stack:
external_links:
- mysql/mysql:mysql
Or more generically:
external_links:
- stack_name/service_name:alias_name
Hope this help !

MySql container stuck at "Restarting..." on Dokku

I tried to create a new mySql database on my Dokku container.
Using
dokku mysql:create bookmarks
The container has been created, but it seems it is unable to start.
The command
# dokku mysql:list
NAME VERSION STATUS EXPOSED PORTS LINKS
bookmarks mysql:5.6.26 restarting - -
I am unable to stop, restart or destroy this container.
# dokku mysql:destroy bookmarks
! WARNING: Potentially Destructive Action
! This command will destroy bookmarks MySQL service.
! To proceed, type "bookmarks"
> bookmarks
-----> Deleting bookmarks
Deleting container data
! Service is already stopped
Removing container
Error response from daemon: Conflict, You cannot remove a running container. Stop the container before attempting removal or use -f
Error: failed to remove containers: [dokku.mysql.bookmarks]
I also tried to reboot the entire server, without any success.
To me, it seems like something went wrong during the creation of this container that makes the system unable to start it. The problem is that at the same time I am unable to stop or restart it, and being unable to stop it I cannot remove it and start from scratch.
# dokku mysql:stop bookmarks
! Service is already stopped
# dokku mysql:restart bookmarks
! Service is already stopped
-----> Starting container
No container exists for bookmarks
-----> Please call dokku ps:restart on all linked apps
The error message says something about "forcing" the process, but I can't find anywhere how to use it.
Does anyone have any idea?
Thank you in advance,
Simone
So, finally with the help from people from DigitalOcean I've been able to stop and destroy that faulty container.
Here is what I did:
Check Docker processes running
docker ps -a
Identify the process that is causing the problem, in my case it was:
8549c8ec4e53 mysql:5.6.26 "/entrypoint.sh mysql" 17 hours ago Restarting (1) 2 hours ago 3306/tcp dokku.mysql.bookmarks
Kill the Docker process
docker kill 8549c8ec4e53
Remove the container from Dokku
dokku mysql:destroy bookmarks
Hope this answer helps others having similar problems.