The following commands allow us to install a MySQL server on Ubuntu 16.04, create a database, user and table. And finally, tune the server. ...
The following commands allow us to install a MySQL server on Ubuntu 16.04, create a database, user and table. And finally, tune the server.
# install mysql
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install mysql-server
sudo mysql_secure_installation
mysql -u root -p
# \h - for help
# create a test database and login account
create database testdb;
create user 'kerri'@'localhost' identified by 'secret';
grant all on testdb.* to 'kerri';
exit
# login using the newly created user
mysql -u kerri -p
# create a table using the newly created database
use testdb;
create table movies (movie_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, movie_name TEXT, release_date DATE);
# reset the MySQL password
sudo service mysql stop
sudo dpkg-reconfigure mysql-server-5.5
sudo service mysql start
# login as root
mysql -u root -p
# tune MySQL
sudo apt-get install mysqltuner
mysqltuner
COMMENTS