Linux mysql fails to start

MySQL Daemon Failed to Start — centos 6

EDIT: Look at the checkmarked answer comments to get your issue solved. Whenever I try to start the SQLD service I get MySQL Daemon Failed to Start. I infact tried to «start» the service by doing the following:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) 

I know that there should be a mysql.sock file in that directory, so I create one. But the file just auto removes its self and I continue to get the error 2002. I am also unable to log into PHPMyAdmin due to the error. I can access phpmyadmin page but when logging in I get: #2002 Cannot log in to the MySQL server EDIT: Here is my mysql.log file:

131201 13:05:07 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended 131201 13:18:18 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 131201 13:18:18 [Note] Plugin 'FEDERATED' is disabled. /usr/libexec/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13) 131201 13:18:18 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. 131201 13:18:18 InnoDB: The InnoDB memory heap is disabled 131201 13:18:18 InnoDB: Mutexes and rw_locks use GCC atomic builtins 131201 13:18:18 InnoDB: Compressed tables use zlib 1.2.3 131201 13:18:18 InnoDB: Using Linux native AIO 131201 13:18:18 InnoDB: Initializing buffer pool, size = 128.0M 131201 13:18:18 InnoDB: Completed initialization of buffer pool 131201 13:18:18 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. 131201 13:18:18 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended 
Looking for 'mysql' as: mysql Looking for 'mysqlcheck' as: mysqlcheck FATAL ERROR: Upgrade failed 

Источник

MySQL doesn’t start at all

This is awsome yesterday I got the same error and I debugged it but today I don’t remember what to do since I did it to fast. When I’m doing:

Job for mysql.service failed. See 'systemctl status mysql.service' and 'journalctl -xn' for details. 
Apr 16 18:11:25 darphus.xen.prgmr.com systemd[1]: Unit mysql.service entered failed state. Apr 16 18:11:26 darphus.xen.prgmr.com systemd[1]: mysql.service holdoff time over, scheduling restart. Apr 16 18:11:26 darphus.xen.prgmr.com systemd[1]: Stopping MySQL Community Server. Apr 16 18:11:26 darphus.xen.prgmr.com systemd[1]: Starting MySQL Community Server. Apr 16 18:11:26 darphus.xen.prgmr.com systemd[1]: mysql.service start request repeated too quickly, refusing to start. Apr 16 18:11:26 darphus.xen.prgmr.com systemd[1]: Failed to start MySQL Community Server. Apr 16 18:11:26 darphus.xen.prgmr.com systemd[1]: Unit mysql.service entered fai 
Logs begin at Sun 2017-04-16 17:58:44 UTC, end at Sun 2017-04-16 18:16:35 UTC Apr 16 18:16:34 darphus.xen.prgmr.com postfix/pickup[938]: warning: 868F625E66: Apr 16 18:16:34 darphus.xen.prgmr.com postfix/pickup[938]: 868F625E66: uid=0 fro Apr 16 18:16:34 darphus.xen.prgmr.com postfix/proxymap[941]: warning: mysql:/etc Apr 16 18:16:34 darphus.xen.prgmr.com postfix/cleanup[1361]: warning: proxy:mysq Apr 16 18:16:34 darphus.xen.prgmr.com postfix/cleanup[1361]: warning: 868F625E66 Apr 16 18:16:35 darphus.xen.prgmr.com postfix/pickup[938]: warning: 8744E25E66: Apr 16 18:16:35 darphus.xen.prgmr.com postfix/pickup[938]: 8744E25E66: uid=0 fro Apr 16 18:16:35 darphus.xen.prgmr.com postfix/proxymap[941]: warning: mysql:/etc Apr 16 18:16:35 darphus.xen.prgmr.com postfix/cleanup[1362]: warning: proxy:mysq Apr 16 18:16:35 darphus.xen.prgmr.com postfix/cleanup[1362]: warning: 8744E25E66 

I think a tryed all the trick on the internet and nothing work for today. Please help me since All my website are down for this reason.

Читайте также:  Linux enter home directory

Источник

MySQL Job failed to start

I’m on Kubuntu 12.04, and after installing mysql via an apt-get (mysql ver: 5.5.35), i’m trying to start mysql service, but I got this error:

So I googled this problem, it says i have to go to the /var/log/mysql/error.log But my error.log file is empty 🙁 Then I checked the permissions :

13 Answers 13

First make a backup of your /var/lib/mysql/ directory just to be safe.

sudo mkdir /home//mysql/ cd /var/lib/mysql/ sudo cp * /home//mysql/ -R 

Next purge MySQL (this will remove php5-mysql and phpmyadmin as well as a number of other libraries so be prepared to re-install some items after this.

sudo apt-get purge mysql-server-5.1 mysql-common 

Remove the folder /etc/mysql/ and it’s contents

Next check that your old database files are still in /var/lib/mysql/ if they are not then copy them back in to the folder then chown root:root

(only run these if the files are no longer there)

sudo mkdir /var/lib/mysql/ sudo chown root:root /var/lib/mysql/ -R cd ~/mysql/ sudo cp * /var/lib/mysql/ -R 

Next install mysql server

sudo apt-get install mysql-server 

Finally re-install any missing packages like phpmyadmin and php5-mysql.

@Ben :This problem may be occurred due to improper installation or uninstall .If you are installed first time in your system it will not occur . There might be some dependencies that are not properly removed completely when you re-installing mysql.

I’m very proccupied then.. my mysql install was running for like more than a year, i’ve upgraded ubuntu then the mysql to 5.5 about a month ago. Never had any problems. Meaning someone made his way into my server you think ?

Have people realized that just rebooting might solve this issue? It worked for me and I think it should be the first attempt before performing these steps.

My problem was running out of memory. Digital ocean has great instruction for adding swap memory for Ubuntu: https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04

This solved the issue and enabled me to restart the Mysql that otherwise would not start.

Reinstallation will works because it will reset all the value to default. It is better to find what the real culprits (my.cnf editing mistake does happens, e.g. bad/outdated parameter suggestion during mysql tuning.)

Here is the mysql diagnosis if you suspect some value is wrong inside my.cnf : Run the mysqld to show you the results.

Читайте также:  Iptv simple client kodi linux

Afterwards, fix all the my.cnf key error that pop out from the screen until mysqld startup successfully.

sudo service mysql restart 

In my case, it simply because the disk is full. Just clear some disk space and restart and everything is fine.

In most cases, just purging the mysql-server package and re-installing it will do the job.

sudo apt-get purge mysql-server-5.1 mysql-common

sudo apt-get install mysql-server

This line did solve the issue in my case,

  1. sudo nano /etc/mysql/my.cnf
  2. search for bind names and IPs
  3. remove the specific, and let only localhost 127.0.0.1 and the hostname

Check the file permissions, if edited

$ sudo chmod 776 /etc/mysql/my.cnf $ sudo service mysql restart mysql stop/waiting start: Job failed to start 
$ sudo chmod 774 /etc/mysql/my.cnf $ sudo service mysql restart stop: Unknown instance: mysql start/running, process 9564 

To help others who do not have a full disk to troubleshoot this problem, first inspect your error log (for me the path is given in my /etc/mysql/my.cnf file):

My problem turned out to be a new IP address allocated after some network router reconfiguration, so I needed to change the bind-address variable.

In my case the problem was the /var/log disk full (check with df -h )

Just deleted some log files and mysql started, no big deal!

The given solution requires enough free HDD, the actual problem was the HDD memory shortage. So If you don’t have an alternative server or free disk space, you need some other alternative.

I faced this error with my production server (Linode VPS) when I was running a bulk download into MySQL. Its not a proper solution but VERY QUICK FIX, which we often need in production to bring things UP FAST.

  1. Resize our VPS Server to higher Hard Disk size
  2. Start MySQL, it works.
  3. Login to your MySQL instance and make appropriate adjustments that caused this error (e.g. remove some records, table, or take DB backup to your local machine that are not required at production, etc. After all you know, what caused this issue.)
  4. Downgrade your VPS Server to previous package you was already using

Источник

I can’t start MySQL on linux — Error mysqld_safe

I found in many forums around the web, but I did not find my solution. When I start the service mysql in linux ubuntu server 12.04, I get this error:

root@stroke:/# mysqld_safe & [1] 5789 root@stroke:/# 131001 10:12:29 mysqld_safe Logging to syslog. 131001 10:12:29 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 131001 10:12:29 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended 

I’ve already given permission to the folder mysql, I’ve also tried to create a new password for the root mysql. But so far nothing has worked. Thanks for help. Some information:

root@stroke:/# /etc/init.d/mysql start Rather than invoking init scripts through /etc/init.d, use the service(8) utility, e.g. service mysql start Since the script you are attempting to invoke has been converted to an Upstart job, you may also use the start(8) utility, e.g. start mysql start: Job failed to start 
# # The MySQL database server configuration file. # # You can copy this to one of: # - "/etc/mysql/my.cnf" to set global options, # - "~/.my.cnf" to set user-specific options. # # One can use all long options that the program supports. # Run program with --help to get a list of available options and with # --print-defaults to see which it would actually understand and use. # # For explanations see # http://dev.mysql.com/doc/mysql/en/server-system-variables.html # This will be passed to all mysql clients # It has been reported that passwords should be enclosed with ticks/quotes # escpecially if they contain "#" chars. # Remember to edit /etc/mysql/debian.cnf when changing the socket location. [client] port = 3306 socket = /var/run/mysqld/mysqld.sock # Here is entries for some specific programs # The following values assume you have at least 32M ram # This was formally known as [safe_mysqld]. Both versions are currently parsed. [mysqld_safe] socket = /var/run/mysqld/mysqld.sock nice = 0 [mysqld] # # * Basic Settings # innodb_force_recovery = 4 user = mysql pid-file = /var/run/mysqld/mysqld.pid socket = /var/run/mysqld/mysqld.sock port = 3306 basedir = /usr datadir = /var/lib/mysql tmpdir = /tmp lc-messages-dir = /usr/share/mysql #skip-external-locking # # Instead of skip-networking the default is now to listen only on # localhost which is more compatible and is not less secure. bind-address = 0.0.0.0 # # * Fine Tuning # key_buffer = 256M max_allowed_packet = 16M thread_stack = 192K thread_cache_size = 8 # This replaces the startup script and checks MyISAM tables if needed # the first time they are touched myisam-recover = BACKUP #max_connections = 100 #table_cache = 64 #thread_concurrency = 10 # # * Query Cache Configuration # query_cache_limit = 16M query_cache_size = 48M # # * Logging and Replication # # Both location gets rotated by the cronjob. # Be aware that this log type is a performance killer. # As of 5.1 you can enable the log at runtime! #general_log_file = /var/log/mysql/mysql.log #general_log = 1 # # Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf. # # Here you can see queries with especially long duration #log_slow_queries = /var/log/mysql/mysql-slow.log #long_query_time = 2 #log-queries-not-using-indexes # # The following can be used as easy to replay backup logs or for replication. # note: if you are setting up a replication slave, see README.Debian about # other settings you may need to change. #server-id = 1 #log_bin = /var/log/mysql/mysql-bin.log expire_logs_days = 10 max_binlog_size = 100M #binlog_do_db = include_database_name #binlog_ignore_db = include_database_name # # * InnoDB # # InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/. # Read the manual for more InnoDB related options. There are many! # # * Security Features # # Read the manual, too, if you want chroot! # chroot = /var/lib/mysql/ # # For generating SSL certificates I recommend the OpenSSL GUI "tinyca". # # ssl-ca=/etc/mysql/cacert.pem # ssl-cert=/etc/mysql/server-cert.pem # ssl-key=/etc/mysql/server-key.pem [mysqldump] quick quote-names max_allowed_packet = 16M [mysql] #no-auto-rehash # faster start of mysql but no tab completition [isamchk] key_buffer = 16M # # * IMPORTANT: Additional settings that can override those from this file! # The files must end with '.cnf', otherwise they'll be ignored. # !includedir /etc/mysql/conf.d/ 

Источник

Оцените статью
Adblock
detector