mysql 8 --skip-symbolic-links - mysql

I am creating a service in docker-compose.
Look for the problem. In the net. most of them ask me to change mysql version.
The code I have in my dockerfile is:
FROM mysql:8
COPY docker-initdb.sql /docker-entrypoint-initdb.d/initdb.sql
RUN ["mysqld", "--skip-mysqlx", "--default-authentication-plugin=mysql_native_password"]
I have this exception. when executing
Step 3/3 : RUN ["mysqld", "--skip-mysqlx", "--default-authentication-plugin=mysql_native_password"]
---> Running in 33916b9536b9
2019-08-22T17:35:34.255249Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
2019-08-22T17:35:34.255316Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.17) starting as process 1
2019-08-22T17:35:34.258135Z 0 [ERROR] [MY-010123] [Server] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
2019-08-22T17:35:34.258191Z 0 [ERROR] [MY-010119] [Server] Aborting
2019-08-22T17:35:34.259440Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.17) MySQL Community Server - GPL.
Thank you.

You should not use RUN but ENTRYPOINT to start the server. RUN is executing at build time. ENTRYPOINT is executed when the container starts.
FROM mysql:8
USER mysql
ENTRYPOINT mysqld --initialize --user=mysql && mysqld --skip-mysqlx --default-authentication-plugin=mysql_native_password
Also, you need to initialize the database and, as the error says, run the server as a different user than root.
Check the container logs for the root user password.

Docker Mysql v8 also gave me this error
2019-08-22T17:35:34.255249Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
2019-08-22T17:35:34.255316Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.17) starting as process 1
2019-08-22T17:35:34.258135Z 0 [ERROR] [MY-010123] [Server] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
2019-08-22T17:35:34.258191Z 0 [ERROR] [MY-010119] [Server] Aborting
2019-08-22T17:35:34.259440Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.17) MySQL Community Server - GPL.
I think MySQL V8 needs some kind of extra config.
So I changed my Mysql image to 5.7.22 version and now it works. It's not the best solution but it's the fastest.

Related

Mysql not starting on docker

I'm using laravel sail to launch a statamic website on my local machine (macOS). All packages are up-to-date and launch correctly however, the mysql service starts, then fails due to "another process with pid 62 is using unix socket file.".
I'm using the default sail docker-compose file, uneditted. It is working on my other, linux machine correctly with no issues. When visiting localhost, I'm met with "SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for mysql failed: Name or service not known" which makes me think that it is connecting somehow as I would normally expect connection refused?
Here are the docker mysql container logs:
[Entrypoint] MySQL Docker Image 8.0.32-1.2.11-server
[Entrypoint] Starting MySQL 8.0.32-1.2.11-server
2023-01-26T21:17:04.876429Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
2023-01-26T21:17:04.878708Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.32) starting as process 1
2023-01-26T21:17:04.885183Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-01-26T21:17:05.037353Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2023-01-26T21:17:05.189336Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2023-01-26T21:17:05.189362Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2023-01-26T21:17:05.189506Z 0 [ERROR] [MY-010259] [Server] Another process with pid 62 is using unix socket file.
2023-01-26T21:17:05.189518Z 0 [ERROR] [MY-010268] [Server] Unable to setup unix socket lock file.
2023-01-26T21:17:05.189521Z 0 [ERROR] [MY-010119] [Server] Aborting
2023-01-26T21:17:06.724573Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.32) MySQL Community Server - GPL.
Thanks in advance.
I solve mine (WSL2, Docker Desktop) by opening the Docker Desktop GUI, opened the Volumes sidebar. Search for all volume that has "mysql" on their name and delete those volumes. Then run docker compose up again.

mysql installation with datadir home directory of user giving permission denied error 13

I am trying to initialize the mysql and datadir=/home/user/mysqldata
but it is througing the error permission denied
root#localhost mysql]# bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/home/user/mysql-data
2021-11-23T17:35:24.562009Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
2021-11-23T17:35:24.562124Z 0 [System] [MY-013169] [Server] /usr/local/mysql-8.0.27-linux-glibc2.12-x86_64/bin/mysqld (mysqld 8.0.27) initializing of server in progress as process 56149
2021-11-23T17:35:24.564873Z 0 [ERROR] [MY-013276] [Server] Failed to set datadir to '/home/user/mysql-data/' (OS errno: 13 - Permission denied)
2021-11-23T17:35:24.564881Z 0 [ERROR] [MY-013236] [Server] The designated data directory /home/user/mysql-data/ is unusable. You can remove all files that the server added to it.
2021-11-23T17:35:24.564978Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-11-23T17:35:24.565137Z 0 [System] [MY-010910] [Server] /usr/local/mysql-8.0.27-linux-glibc2.12-x86_64/bin/mysqld: Shutdown complete (mysqld 8.0.27) MySQL Community Server - GPL.```
I create a folder /home/user/mysql-data and changed the ownership to mysql and changed the mode also to 750/777 also.
Also disabled selinux, Os is centos 6.9

Keyring mirgration failure Fedora mySql

I've been working through MySQL but I've been having trouble entering my MySQL server to change certain properties. When I attempt to enter as root I get the following output:
//]$ sudo mysqld -u root -p
Enter password:
mysqld: Can not perform keyring migration : Invalid --keyring-migration-source option.
2020-02-12T05:34:59.837715Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.19) starting as process 64421
2020-02-12T05:34:59.839462Z 0 [ERROR] [MY-011084] [Server] Keyring migration failed.
2020-02-12T05:34:59.839481Z 0 [ERROR] [MY-010119] [Server] Aborting
2020-02-12T05:34:59.839559Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.19) MySQL Community Server - GPL.
Can't figure out how to sort this out. Any help would be much appreciated.
keyring-migration-source exists in one of the configuration files.
mysqld --help --verbose will list which files are read at the top. Look in those and remove the line.
Also don't run mysqld as root. Its a security hazard and won't start. Use the systemctl start mysql that fedora provides.

Docker MySQL shutdown immediately after startup, no visible errors in logs

I follow the instructions on the Docker Hub MySQL page (https://hub.docker.com/_/mysql) by running the command (excluding the $)
$ docker run --name mysql8016 -e MYSQL_ROOT_PASSWORD=password1 -d mysql:8.0.16
After pulling the images, the container seems to start but then immediately shuts down. This is the log I read from docker container logs mysql8016:
Initializing database
2019-12-10T00:51:09.949734Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
2019-12-10T00:51:09.949862Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.16) initializing of server in progress as process 27
2019-12-10T00:51:19.627834Z 5 [Warning] [MY-010453] [Server] root#localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
2019-12-10T00:51:30.920219Z 0 [System] [MY-013170] [Server] /usr/sbin/mysqld (mysqld 8.0.16) initializing of server has completed
Database initialized
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
2019-12-10T00:51:33.618057Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
2019-12-10T00:51:33.618660Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.16) starting as process 78
2019-12-10T00:51:36.468597Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2019-12-10T00:51:36.480371Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
2019-12-10T00:51:36.611544Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.16' socket: '/var/run/mysqld/mysqld.sock' port: 0 MySQL Community Server - GPL.
2019-12-10T00:51:36.772724Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: '/var/run/mysqld/mysqlx.sock'
Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone1970.tab' as time zone. Skipping it.
2019-12-10T00:52:07.732230911Z
2019-12-10T00:52:09.583342Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.16) MySQL Community Server - GPL.
2019-12-10T00:52:09.649848201Z
MySQL init process done. Ready for start up.
2019-12-10T00:52:09.650010601Z
2019-12-10T00:52:10.213653Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
2019-12-10T00:52:10.213854Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.16) starting as process 1
2019-12-10T00:52:12.183920Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2019-12-10T00:52:12.192385Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
2019-12-10T00:52:12.342685Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.16' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server - GPL.
2019-12-10T00:52:12.529767Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: '/var/run/mysqld/mysqlx.sock' bind-address: '::' port: 33060
As the logs do not contain any visible errors, I'm not sure if any of those warnings are enough to cause the immediate shutdown, not sure how to go about fixing this.

Mysql - Job for mysqld.service failed because the control process exited with error code

I installed mysql80-community-release-el7-1.noarch.rpm in my Centos 7 using this link successfully and I was trying to change my datadir using the following link. It worked fine till step 2 but at step 3 when i tried to start mysql using sudo systemctl start mysqld it gave me an error like this :
Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.
I have tried the following solutions:
First
Second
But none of them seem to work for me. This is what my /var/log/mysqld.log file says :
2018-06-15T09:08:32.294452Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.11) initializing of server in progress as process 14593
2018-06-15T09:08:37.698910Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root#localhost: 7Y8An3/,r?ww
2018-06-15T09:08:40.729296Z 0 [System] [MY-013170] [Server] /usr/sbin/mysqld (mysqld 8.0.11) initializing of server has completed
2018-06-15T09:08:43.257796Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.11) starting as process 14695
2018-06-15T09:08:43.896289Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2018-06-15T09:08:43.936018Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.11' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server - GPL.
2018-06-15T09:21:15.039285Z 0 [Warning] [MY-011068] [Server] The syntax 'validate password plugin' is deprecated and will be removed in a future release. Please use validate_password component instead.
2018-06-15T09:21:16.575642Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.11) MySQL Community Server - GPL
I am new to this.