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

9 Mẹo lập trình Web “ẩn mình” giúp tiết kiệm hàng giờ đồng hồ

Hầu hết các lập trình viên (kể cả những người giỏi) đều tốn thời gian x

Can GPT-4o Generate Images? All You Need to Know about GPT-4o-image

OpenAI‘s GPT-4o, introduced on March 25, 2025, has revolutionized the way we create visual con

Khi nào nên dùng main, section, article, header, footer, và aside trong HTML5

HTML5 đã giới thiệu các thẻ ngữ nghĩa giúp cấu trúc nội dung web một cách có

So sánh Webhook và API: Khi nào nên sử dụng?

Trong lĩnh vực công nghệ thông tin và phát triển phần mềm, Webhook và API là hai th