Install MySQL database on Ubuntu and add new user.

Installing MySQL on Ubuntu requires only a few simple steps.

  1. sudo apt-get install mysql-server
  2. sudo netstat -tap | grep mysql
  3. sudo vi /etc/mysql/my.cnf
  4. sudo service mysql restart

To look for some simple performance and security suggestions:

  1. sudo apt-get install mysqltuner
  2. mysqltuner

Adding a new user is equally easy…

  1. mysql --user=root --password=mypassword mysql
  2. CREATE USER 'myusername'@'%' IDENTIFIED BY 'mypassword';
    GRANT ALL PRIVILEGES ON *.* TO 'mydatabase'@'%' WITH GRANT OPTION;
    FLUSH PRIVILEGES;

NOTE: This allows access to the user from ALL hosts, it can be limited by replacing the '%' with a specific hostname (such as ‘localhost’ if desired) for security.

REFERENCES:

MySQL (Windows) service startup error 1067

I’ve installed and managed dozens of MySQL installations for several years, occasionally it seems that an install just doesn’t run like it has in the past.

Recently I had a problem where the service would not start (Error 1067) on Windows Server 2003 (R2)… which is running under VMWare. After checking the obvious places and turning up nothing I started down the list of potential solutions exposed by Google search.

The ultimate solution it seems is that the ‘my.ini’ file needed to include the specific path information required by the service…. without it the service would not start.

Here’s my current file (c:\windows\my.ini) for reference:

[WinMySQLAdmin]
Server=C:/mysql40/bin/mysqld-nt.exe
[mysqld]
basedir=c:/mysql40
datadir=c:/mysql40/data

For the really observant readers of this entry… you will notice that this is for MySQL 4.0 (which is no longer officially supported). It’s mostly used as it is widely compatible across various host systems that are sometimes problematic with newer releases.

Cheers.