1sudo apt update
2sudo apt install mysql-server
3sudo service mysql start
4sudo mysql_secure_installation
5sudo mysql -u root
6
7In mysql console:
8DROP USER 'root'@'localhost';
9CREATE USER 'root'@'%' IDENTIFIED BY 'YOURPASSWORD';
10GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
11FLUSH PRIVILEGES;
1$ mysql
2$ sudo apt-get install mysql-server
3$ mysql -u root -p
4$ sudo mysql -u root -p
5$ use mysql;
6$ update user set plugin=”mysql_native_password” where user=’root’;
7$ flush privileges;
8$ exit
9$ mysql -u root -p
10$ create database demo;
11$ show databases;