Install
sudo apt-get install mysql-server mysql-client

Set root user password for localhost
sudo mysqladmin -u root -h localhost password ‘urpassword’

Set root user password for anyhost:
sudo mysqladmin -u root -h hostname password ‘urpassword’

Open mysql shell
mysql -u root -p

Allow hosts(machines) to access mysql installed on other machine(login to mysql shell)

mysql>grant * on mydatabase.* to myuser@’urMachine.domain.com’ identified by ‘myuserpasswd’
mysql> flush privileges;

Database
mysql>create database ;
mysql> use ;
mysql>CREATE TABLE authors (id INT, name VARCHAR(20), email VARCHAR(20),PRIMARY KEY (id));
mysql>INSERT INTO authors (id,name,email) VALUES(1,”John”,”john@gmail.com”);

Share this:

Leave a Reply

Your email address will not be published. Required fields are marked *