Installing MySQL on Ubuntu requires only a few simple steps.
sudo apt-get install mysql-server
sudo netstat -tap | grep mysql
sudo vi /etc/mysql/my.cnf
sudo service mysql restart
To look for some simple performance and security suggestions:
sudo apt-get install mysqltuner
mysqltuner
Adding a new user is equally easy…
mysql --user=root --password=mypassword mysql
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: