Tutorial setting eviroment rvm, ruby, ruby on rails, mysql, connect with mysql workbench trong ubuntu | Trần Hữu Thắng

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

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 && check ruby --version

INSTALL RAILS

  • Step 11: sudo apt install ruby-railties & check rails -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 enter ALTER 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 enter SHOW 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

Bài viết liên quan

Cấu hình Prisma v7 Với Nest.js Mới nhất

Setup Prisma v7 trong Nest.js Bài viết dành cho ai mới học Nest.js và chọn prisma làm OR

Tấn Công Ứng Dụng Web: Mối Đe Dọa Hàng Đầu – Phần 2

viết lại nội dung này ” Phát hiện các cuộc tấn công Cross Site Scripting (XSS)

AI Chatbot 2025: Xu Hướng Tất Yếu Cho Doanh Nghiệp Dẫn Đầu

Giới thiệu AI chatbots đã trải qua một hành trình đáng kể, từ những công cụ t

Tấn Công Ứng Dụng Web: Mối Đe Dọa Hàng Đầu – Phần 1

Tấn công web là gì? Ứng dụng web là các ứng dụng cung cấp dịch vụ cho người