## installation
sudo apt install mysql-server
pip install mysql-server
## set up security
sudo mysql_secure_installation
## login
sudo mysql -u root
## create user
- CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';
## Create mysql db
## Change mysql==8.0.27 password in Ubuntu 20.04.1
sudo /etc/init.d/mysql stop
(maybe): sudo mkdir /var/run/mysqld && sudo chown mysql /var/run/mysqld
sudo mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
mysql -u root mysql
flush privileges;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'Password=1234';
sudo killall -u mysql
sudo systemctl restart mysql.service
sudo mysql -u root -p
################## Clone DB ################
Make a dump of your source database:
Or, if you only want to dump the database's table structure (schema) without any contents:
Open up a MySQL shell:
From the MySQL shell, create a new database and populate it with the dumped data:
Create a user and give it permissions to the new database: