15 May 2014

MySQL on Ubuntu

Notes on MySQL install on Ubuntu.



All commands as root/sudo.

Install MySQL

  • apt-get install mysql-server
  • apt-get install php5-mysql (if you're connecting from PHP)
See the notes on Ubuntu.com but specifically change the binding:
  • vi /etc/mysql/my.cnf
  • change bind-address to servers address or comment it

Create a Database and grant access:

  1. mysql -u root -p
  2. CREATE DATABASE <database name>;
  3. CREATE USER '<mysql username>'@'localhost' IDENTIFIED BY '<password>;
  4. GRANT ALL PRIVILEGES ON <mysql username>.* TO '<database name>'@<client server name or IP address> IDENTIFIED BY '<mysql username password>';
  5. quit

No comments:

Post a Comment