After editing my.cnf MySQL fails to restart

178

First of all check mysql logs and error logs to see whats going on with mysql service,if you see no error logs than you can deploy these steps.

Check if there is any running MySQL process

ps aux | grep mysql

If you are able to see any mysql process like below, just kill that process.

kill -9 pid

Make sure that there is no mysql process running at this point. Restart MySQL.

OR

Try moving the mysql config file /etc/my.cnf file and restart mysql.

mv /etc/my.cnf /etc/my.cnf.backup

Restart mysql.

OR

Try to move the log file named ib_logfile in /var/lib/mysql and restart mysql. Sometimes mysql will fail because it face difficulty updating the log file.

mv /var/lib/mysql/ib_logfile* /root/

Restart and see the results.

service mysqld restart

You can also remove ib_logfile as it will be created automatically after mysql restart.

Share:
178

Related videos on Youtube

SwiftyKai
Author by

SwiftyKai

Updated on September 18, 2022

Comments

  • SwiftyKai
    SwiftyKai over 1 year

    I have a collection view with paging enabled but somehow in last cell it is stuck if I tried to scroll right. I tried to disable bounce on scroll but still happening. It is not happening in xcode 10.3

    enter image description here enter image description here

    extension ViewController: UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout {
        func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
            return videos.count
        }
    
        func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
            let cell = collectionview.dequeueReusableCell(withReuseIdentifier: "VideoPlayerCollectionViewCell", for: indexPath) as! VideoPlayerCollectionViewCell
           return cell
        }
    
        func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
            return CGSize(width: self.view.frame.width , height: self.view.frame.height)
    
        }
    
        func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {
            return 0
        }
    }
    
    • ADM
      ADM almost 10 years
    • Felix Frank
      Felix Frank almost 10 years
      FWIW, I'm not aware that set-variable = max_allowed_packet=24M is valid my.cnf syntax. You set variables by just putting the name=value pair in there.
    • Earl
      Earl almost 10 years
      ah so this is the right syntax, previously is for old mysql syntax [mysqld] max_allowed_packet=24M max_connections=300 log-slow-queries local-infile=0 open_files_limit=3980 btw if i add safe-show-database, got FAILED message too, is it already changed too?
    • Spero
      Spero over 6 years
      I know this is quite old, but doesn't the error log location depend on the settings in my.cnf? If my.cnf fails to load, then there will be no error log.
  • ADM
    ADM almost 10 years
    omg, why all this fuss instead of just opening your error log ??
  • deweydb
    deweydb about 7 years
    @ADM in my case there is no error in the error logs.