skip to Main Content

i deleted and reinstall mariadb and i get this error:

“Job for mariadb.service failed because the control process exited with error code. See “systemctl status mariadb.service” and “journalctl -xe” for details.”

when i use systemctl” status mariadb.service” i get this

● mariadb.service - MariaDB 10.4.13 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
    Drop-In: /etc/systemd/system/mariadb.service.d
             └─migrated-from-my.cnf-settings.conf
     Active: failed (Result: exit-code) since Sat 2020-05-30 09:37:19 +00; 15s ago
       Docs: man:mysqld(8)
             https://mariadb.com/kb/en/library/systemd/
    Process: 9859 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
    Process: 9860 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Process: 9862 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
    Process: 10002 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Process: 10034 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Process: 10036 ExecStartPost=/etc/mysql/debian-start (code=exited, status=203/EXEC)
   Main PID: 10002 (code=exited, status=0/SUCCESS)
     Status: "MariaDB server is down"

mai 30 09:37:17 Tv mysqld[10002]: 2020-05-30  9:37:17 0 [Note] InnoDB: FTS optimize thread exiting.
mai 30 09:37:17 Tv systemd[1]: mariadb.service: Control process exited, code=exited, status=203/EXEC
mai 30 09:37:17 Tv mysqld[10002]: 2020-05-30  9:37:17 0 [Note] InnoDB: Starting shutdown...
mai 30 09:37:17 Tv mysqld[10002]: 2020-05-30  9:37:17 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
mai 30 09:37:17 Tv mysqld[10002]: 2020-05-30  9:37:17 0 [Note] InnoDB: Buffer pool(s) dump completed at 200530  9:37:17
mai 30 09:37:19 Tv mysqld[10002]: 2020-05-30  9:37:19 0 [Note] InnoDB: Shutdown completed; log sequence number 61044; transaction id 22
mai 30 09:37:19 Tv mysqld[10002]: 2020-05-30  9:37:19 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
mai 30 09:37:19 Tv mysqld[10002]: 2020-05-30  9:37:19 0 [Note] /usr/sbin/mysqld: Shutdown complete
mai 30 09:37:19 Tv systemd[1]: mariadb.service: Failed with result 'exit-code'.
mai 30 09:37:19 Tv systemd[1]: Failed to start MariaDB 10.4.13 database server.

P.S

to delete the package i use this command
fisrt:

$ sudo apt-get remove --purge mysql-server mysql-client mysql-common -y
$ sudo apt-get autoremove -y
$ sudo apt-get autoclean

and i search all fils by

sudo dpkg -l | grep -i mysql

to delete it completly

and i reintall it

sudo apt-get install libmysqlclient-dev mysql-client
sudo apt-get install mysql-server


sudo apt-get remove mysql-server mysql-client mysql-common
sudo apt-get purge mysql-server mysql-client mysql-common
sudo apt-get autoremove

i use this site web to help at this
[How to remove MySQL completely with config and library files?

2

Answers


  1. If you haven’t any real data in your database then clear all in /var/lib/mysql.

    After that try again to run command mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql to initialize database directory.

    Login or Signup to reply.
  2. If somehow mysql stopped and another service used the port that mysql was using, then it gives this error.

    Possible solutions:

    1)
    I assume mysql port number is 3306

    netstat -nlp | grep 3306
    tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      1206/not_mysqld
    kill -9 1206
    

    if the result is not mysqld, solution found. Kill the port and run mysql again.

    2)
    Restart machine. Because if you did not realize what happened when you encountered this error, it probably means that you did not make any permanent changes and when you turn on the computer again, the old port will most likely start working.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search