Skip to content

mysql installation on ubuntu failed

2011 December 9
by PK

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
5 Responses leave one →
  1. December 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.

  2. PK permalink*
    December 13, 2011

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

  3. December 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.

  4. PK permalink*
    December 27, 2011

    Thanks Steve for catching the typo!

  5. Spencer permalink
    January 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.

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS