INSTALL RVM
- Step 1:
sudo apt-get update
- Step 2:
sudo apt install gnupg2
- Step 3:
sudo apt install curl
- Step 4:
curl -sSL https://rvm.io/mpapis.asc | gpg --import -
- Step 5:
curl -sSL https://rvm.io/pkuczynski.asc | gpg --import -
- Step 6:
curl -sSL https://get.rvm.io | bash -s stable
&&source ~/.bashrc
- Step 7:
rvm --version
INSTALL RUBY
- Step 8:
rvm install ruby
- Step 9:
rvm install 2.7.2
- Step 10:
sudo apt install ruby
&& checkruby --version
INSTALL RAILS
- Step 11:
sudo apt install ruby-railties
& checkrails -v
- Step 12:
/bin/bash --login
&&rvm use 2.7.2 --default
- Step 13: install rails version , i install rails 6.1
gem install rails --version=6.1.4
&&rails -v
INSTALL MYSQL
- Step 14:
sudo apt install mysql-server
-
Step 15:
sudo mysql_secure_installation
Come here, you set a password and keep saying yes -
Step 16:
sudo mysql -u root -p
Press enterALTER USER 'user'@'localhost' IDENTIFIED WITH mysql_native_password BY 'welcome123';
- Step 17:
ALTER USER 'user'@'localhost' IDENTIFIED WITH mysql_native_password BY 'welcome123';
in case error Your password does not satisfy the current policy requirements
then enterSHOW VARIABLES LIKE 'validate_password%';
enter 3 line this code
SET GLOBAL validate_password_policy=LOW;
SET GLOBAL validate_password.length = 9;
SET GLOBAL validate_password.number_count = 0;
If there is no error, continue
This is you set your mysql password, to connect the database
- Step 19 :
sudo mysql -u root -p
Result
That’s it, just to be sure, try to enter it wrong and see if it gives you this error, Result
DONE !
Install mysql workbench
- Step 20 :
Result
- Step 21: connect mysql workbech
Enter your password mysql
result :
Done
Nguồn: viblo.asia