ubuntu, MySQL change datadir - mysql

I just installed Mysql 5.7 on new ubuntu distribution 16.
I am trying to move Mysql Datadir into a specific Disk. I followed then
But when trying to start mysql it fails
mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: inactive (dead) (Result: exit-code) since mer. 2016-08-17 21:08:09 CEST; 10s ago
Process: 4735 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=1/FAILURE)
août 17 21:08:09 getesa systemd[1]: mysql.service: Unit entered failed state.
août 17 21:08:09 getesa systemd[1]: mysql.service: Failed with result 'exit-code'.
août 17 21:08:09 getesa systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
août 17 21:08:09 getesa systemd[1]: Stopped MySQL Community Server.
août 17 21:08:09 getesa systemd[1]: mysql.service: Start request repeated too quickly.
août 17 21:08:09 getesa systemd[1]: Failed to start MySQL Community Server.
Please help me.

Related

cant start mysql server

I cannot start Mysql-server on ubuntu 20.04 when I try systemctl status mysql.service i got this message:
mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2021-08-24 11:27:20 UTC; 12s ago
Process: 46074 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited,
status=1/FAILURE)
Aug 24 11:27:20 virtualmin systemd[1]: mysql.service: Control process exited,
code=exited, status=1/FAILURE
Aug 24 11:27:20 virtualmin systemd[1]: mysql.service: Failed with result 'exit-code'.
Aug 24 11:27:20 virtualmin systemd[1]: Failed to start MySQL Community Server.
Aug 24 11:27:20 virtualmin systemd[1]: mysql.service: Scheduled restart job, restart
counter is at 5.
Aug 24 11:27:20 virtualmin systemd[1]: Stopped MySQL Community Server.
Aug 24 11:27:20 virtualmin systemd[1]: mysql.service: Start request repeated too
quickly.
Aug 24 11:27:20 virtualmin systemd[1]: mysql.service: Failed with result 'exit-code'.
Aug 24 11:27:20 virtualmin systemd[1]: Failed to start MySQL Community Server.
mostly other service is running on the same port (3306) ,
try
netstat -pnltu | grep -i "3306"
it will show all services running on that port , if there are any , just end it and restart your Mysql server

mysql - failed unable to start

I don't know why this error
Error message:
root#li1714-176:/data/mysql# systemctl status mysqld.service
● mysqld.service - LSB: start and stop MySQL
Loaded: loaded (/etc/init.d/mysqld; generated)
Active: failed (Result: exit-code) since Wed 2020-03-25 08:47:34 CST; 23min ago
Docs: man:systemd-sysv-generator(8)
Process: 3776 ExecStart=/etc/init.d/mysqld start (code=exited, status=1/FAILURE)
Mar 25 08:47:32 li1714-176 systemd[1]: Starting LSB: start and stop MySQL...
Mar 25 08:47:32 li1714-176 mysqld[3776]: Starting MySQL
Mar 25 08:47:34 li1714-176 mysqld[3776]: .. * The server quit without updating PID file (/data/mysql/mysql.pid).
Mar 25 08:47:34 li1714-176 systemd[1]: mysqld.service: Control process exited, code=exited status=1
Mar 25 08:47:34 li1714-176 systemd[1]: mysqld.service: Failed with result 'exit-code'.
Mar 25 08:47:34 li1714-176 systemd[1]: Failed to start LSB: start and stop MySQL.
Mar 25 09:31:52 li1714-176 rsyslogd[588]: file '7' write error: No space left on device [v8.32.0 try http://www.rsyslog.com/e/2027 ]
Mar 25 09:31:52 li1714-176 rsyslogd[588]: action 'action 2' (module 'builtin:omfile') message lost, could not be processed. Check for additional error messa
Mar 25 09:31:52 li1714-176 rsyslogd[588]: file '7' write error: No space left on device [v8.32.0 try http://www.rsyslog.com/e/2027 ]
Mar 25 09:31:54 li1714-176 sshd[8551]: Failed password for invalid user mk from 170.231.57.142 port 6220 ssh2
Mar 25 09:31:54 li1714-176 sshd[8551]: Received disconnect from 170.231.57.142 port 6220:11: Bye Bye [preauth]
Mar 25 09:31:54 li1714-176 sshd[8551]: Disconnected from invalid user mk 170.231.57.142 port 6220 [preauth]
journalctl -u mysqld.service error:
Mar 25 06:40:19 li1714-176 systemd[1]: Starting LSB: start and stop MySQL...
Mar 25 06:40:19 li1714-176 mysqld[751]: Starting MySQL
Mar 25 06:40:21 li1714-176 mysqld[751]: .. * The server quit without updating PID file (/data/mysql/mysql.pid).
Mar 25 06:40:21 li1714-176 systemd[1]: mysqld.service: Control process exited, code=exited status=1
Mar 25 06:40:21 li1714-176 systemd[1]: mysqld.service: Failed with result 'exit-code'.
Mar 25 06:40:21 li1714-176 systemd[1]: Failed to start LSB: start and stop MySQL.
Mar 25 08:47:32 li1714-176 systemd[1]: Starting LSB: start and stop MySQL...
Mar 25 08:47:32 li1714-176 mysqld[3776]: Starting MySQL
Mar 25 08:47:34 li1714-176 mysqld[3776]: .. * The server quit without updating PID file (/data/mysql/mysql.pid).
Mar 25 08:47:34 li1714-176 systemd[1]: mysqld.service: Control process exited, code=exited status=1
Mar 25 08:47:34 li1714-176 systemd[1]: mysqld.service: Failed with result 'exit-code'.
Mar 25 08:47:34 li1714-176 systemd[1]: Failed to start LSB: start and stop MySQL.
Mar 25 09:31:40 li1714-176 systemd[1]: Starting LSB: start and stop MySQL...
Mar 25 09:31:40 li1714-176 mysqld[7625]: Starting MySQL
Mar 25 09:31:42 li1714-176 mysqld[7625]: .. * The server quit without updating PID file (/data/mysql/mysql.pid).
How to free up more space.
I want to start or extract the database normally
Given rsyslog is complaining about 'No space left on device' I suspect that mysql will have the same problem. It needs space to work as well.
journalctl -u mysqld.service
to see mysql errors, though it is probably also having limited recording due to out of space.
Fix the amount of free space on your storage and make all your programs happy.

MySQL 5.7.27 can’t start

I just installed MySQL 5.7.23 on Centos 7. As soon as I do systemctl start mysqld gives me an error. Making systemctl status mysqld returns:
●�mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
���Active: failed�(Result: start-limit) since Tue 2019-08-27 02:55:20 CEST; 11min ago
�����Docs: man:mysqld(8)
���������http://dev.mysql.com/doc/refman/en/using-systemd.html
��Process: 11299 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=1/FAILURE)
��Process: 11281 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Aug 27 02:55:20 server0-centos7 systemd[1]: mysqld.service: control process exited, code=exited status=1
Aug 27 02:55:20 server0-centos7 systemd[1]: Failed to start MySQL Server.
Aug 27 02:55:20 server0-centos7 systemd[1]: Unit mysqld.service entered failed state.
Aug 27 02:55:20 server0-centos7 systemd[1]: mysqld.service failed.
Aug 27 02:55:20 server0-centos7 systemd[1]: mysqld.service holdoff time over, scheduling restart.
Aug 27 02:55:20 server0-centos7 systemd[1]: Stopped MySQL Server.
Aug 27 02:55:20 server0-centos7 systemd[1]: start request repeated too quickly for mysqld.service
Aug 27 02:55:20 server0-centos7 systemd[1]: Failed to start MySQL Server.
Aug 27 02:55:20 server0-centos7 systemd[1]: Unit mysqld.service entered failed state.
Aug 27 02:55:20 server0-centos7 systemd[1]: mysqld.service failed.
There can be various reasons for this issue.
Required folder permissions may not be there.
Please find the answer related to folder permission here.
Job for mysqld.service failed in Centos 7
You may have less RAM free with the MySQL service stopped, so as soon as you run:
systemctl start mysqld
MySQL is attempting to utilize more than what’s available and since it’s unable to do so, it fails.
For database-driven websites, I recommend at least 1GB of RAM minimum. if you still want to run with less MB of RAM then I’d recommend NGINX over Apache.

I tried to reinstall MySQL on centos and now it doesn't start

I tried to reinstall MySQL and now it doesn't even start, and if I go to "messages" it says this
Jul 23 11:04:27 systemd: Starting MySQL Server...
Jul 23 11:04:29 systemd: mysqld.service: main process exited, code=exited, status=1/FAILURE
Jul 23 11:04:29 systemd: Failed to start MySQL Server.
Jul 23 11:04:29 systemd: Unit mysqld.service entered failed state.
Jul 23 11:04:29 systemd: mysqld.service failed.

systemctl status mariadb.service

i know that vendor preset: disabled is fine
i have changer the chown for mysql directory
even the chown for mysql.sock changed it three times
and still getting the same error
So any help will be thankful even if you are new
● mariadb.service - MariaDB 10.3 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Drop-In: /usr/lib/systemd/system/mariadb.service.d
└─tokudb.conf
Active: failed (Result: exit-code) since Thu 2019-01-31 00:04:01 EET; 2min 39s ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Process: 1121 ExecStartPre=/usr/libexec/mysql-prepare-db-dir mariadb.service (code=exited, status=1/FAILURE)
Process: 1038 ExecStartPre=/usr/libexec/mysql-check-socket (code=exited, status=0/SUCCESS)
Jan 31 00:03:55 localhost.localdomain systemd[1]: Starting MariaDB 10.3 database server...
Jan 31 00:04:01 localhost.localdomain mysql-prepare-db-dir[1121]: The log file /var/log/mariadb/mariadb.log cannot be written, please, fix its permissions.
Jan 31 00:04:01 localhost.localdomain mysql-prepare-db-dir[1121]: The daemon will be run under mysql:mysql
Jan 31 00:04:01 localhost.localdomain systemd[1]: mariadb.service: Control process exited, code=exited status=1
Jan 31 00:04:01 localhost.localdomain systemd[1]: mariadb.service: Failed with result 'exit-code'.
Jan 31 00:04:01 localhost.localdomain systemd[1]: Failed to start MariaDB 10.3 database server.
So any help will be thankful even if you are new .