Installing MySQL on Ubuntu Server

I recently set up a basic MySQL server instance for testing JDBC support in JTemplate. It took me a little while to figure out how to do it, so I wanted to capture the steps in case it is useful to anyone (including my future self):

  • Download and install Ubuntu Server 15.04 (Vivid Vervet)
  • Install Avahi (Bonjour/Zeroconf for Linux) so clients can resolve the server name:
    > sudo apt-get install avahi-daemon
  • Install MySQL:
    > sudo apt-get install mysql-server
  • Edit /etc/mysql/mysql.conf.d/mysqld.cnf to allow remote connections:
    bind-address 0.0.0.0
  • Allow the MySQL root user to log in remotely:
    > mysql --user=root --password=password
    
    GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
    FLUSH PRIVILEGES;
  • Download and install MySQL Workbench

You should now be able to start MySQL Workbench and create a connection to the database server. The host name should be the name you gave to the server when you installed the operating system plus ".local"; e.g. "db.local".

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s