Installing MYSQL On Ubuntu
First, update the apt package index by typing:
sudo apt update
Then install the MySQL package with the following command:
sudo apt install mysql-server
Once the installation is completed, the MySQL service will start automatically. To check whether the MySQL server is running, type:
sudo systemctl status mysql
MySQL server package comes with a script called mysql_secure_installation that can perform several security-related operations.
Run the script by typing:
sudo mysql_secure_installation
If you want to login to your MySQL server as root from an external program such as Mysql Workbench you have two options.
The first one is to change the authentication method from auth_socket to mysql_native_password. You can do that by running the following command:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'very_strong_password';FLUSH PRIVILEGES;
The second, recommended option is to create a new administrative user with access to all databases:
GRANT ALL PRIVILEGES ON *.* TO 'administrator'@'localhost' IDENTIFIED BY 'very_strong_password';
References:
https://linuxize.com/post/how-to-install-mysql-on-ubuntu-18-04/
https://www.youtube.com/watch?v=ug0TFsort24
First, update the apt package index by typing:
sudo apt update
sudo apt install mysql-server
Once the installation is completed, the MySQL service will start automatically. To check whether the MySQL server is running, type:
sudo systemctl status mysql
MySQL server package comes with a script called
mysql_secure_installation that can perform several security-related operations.
Run the script by typing:
sudo mysql_secure_installation
If you want to login to your MySQL server as root from an external program such as Mysql Workbench you have two options.
The first one is to change the authentication method from
auth_socket to mysql_native_password. You can do that by running the following command:ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'very_strong_password';FLUSH PRIVILEGES;
The second, recommended option is to create a new administrative user with access to all databases:
GRANT ALL PRIVILEGES ON *.* TO 'administrator'@'localhost' IDENTIFIED BY 'very_strong_password';
References:
https://linuxize.com/post/how-to-install-mysql-on-ubuntu-18-04/
https://www.youtube.com/watch?v=ug0TFsort24
No comments:
Post a Comment