mysql installation on ubuntu failed

mysql installation on ubuntu failed

We often use wordpress as the CMS for our application’s public site. That means we have to install mysql on our rackspace servers. Today the installation process failed several times, with this error message in syslog.

Error:


ERROR: 1064  You have an error in your SQL syntax; check the manual
that corresponds to your MySQL server version for the right syntax to
use near 'ALTER TABLE user ADD column Show_view_priv enum\('N','Y')
 CHARACTER SET utf8 NOT ' at line 1

I first try to uninstall and reinstall sqlserver but it will not uninstall cleanly. Finally I have to both use apt-get and manually remove some directories to get back to a clean install:

apt-get purge mysql-server
apt-get purge mysql-common
rm -rf /var/log/mysql
rm -rf /var/log/mysql.*
rm -rf /var/lib/mysql
rm -rf /etc/mysql
# and then:
apt-get install mysql-server --fix-missing --fix-broken

Then I get a clean (re)install of mysql and it started up.

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Posterous
  • Tumblr
  • Twitter

9 Comments

  • Bill on Dec 13, 2012

    You are the greatest! I have been trying to sort this for hours!

  • Deeqee on Sep 04, 2012

    Thx a lot man, i had been worked for several weeks frustating until I found your post :-)

  • venki on Jul 30, 2012

    I have followed the same procedures but no use the same error exists. I have got the following syslog

    ERROR: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘ALTER TABLE user ADD column Show_view_priv enum(‘N’,'Y’) CHARACTER SET utf8 NOT ‘ at line 1
    Jul 30 14:51:24 Milan mysqld_safe[9890]: 120730 14:51:24 [ERROR] Aborting
    ERROR: 1050 Table ‘plugin’ already exists

    [ERROR] Can’t create IP socket: Permission denied

    error: ‘Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)’

  • steve on Jul 18, 2012

    This worked perfectly for me on Ubuntu 12.0.4. I appreciate you sharing!

  • Spencer on Jan 12, 2012

    Thanks, this worked for me on Ubuntu 10.04.3 LTS. I started off with the following error:

    ERROR: 1050 Table ‘plugin’ already exists

    When I reinstalled mysql-server I started getting the same error as you. Running your solution finally fixed it.

  • PK on Dec 27, 2011

    Thanks Steve for catching the typo!

  • Steve Jones on Dec 27, 2011

    Thanks so much for this – I couldn’t figure out what was wrong for the life of me.

    Incidentally, I think you meant ‘/etc/mysql’ instead of ‘/var/etc/mysql’ in the last rm line of your instructions.

  • PK on Dec 13, 2011

    You are welcome Ben. I too almost gave up and thought about a complete rebuild!

  • Benjamin Sautner on Dec 13, 2011

    thanks – i was about to rebuild my server when i found this and it worked. I messed up a new mysql install while moving the data director, then i couldn’t reinstall. This cleaned it up.

Leave Reply