how to start mysql in ubuntu code example

Example 1: start mysql server ubuntu

sudo service mysql-server

Example 2: how to install mysql ubuntu

sudo apt update
sudo apt install mysql-server
sudo service mysql start
sudo mysql_secure_installation
sudo mysql -u root 

In mysql console:
DROP USER 'root'@'localhost';
CREATE USER 'root'@'%' IDENTIFIED BY 'YOURPASSWORD';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;

Example 3: start stop mysql linux

service mysql start
service mysql stop
service mysql restart

Example 4: setup mysql ubuntu

sudo apt install mysql-server
sudo mysql_secure_installation utility

Example 5: start mysql

mysql-ctl cli

Example 6: ubuntu install mysql

sudo apt install mysql-server