Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Comments on How to solve Lost connection to MySQL server at 'reading initial communication packet', system error: 0

Parent

How to solve Lost connection to MySQL server at 'reading initial communication packet', system error: 0 Question

+0
−0

screenshot of text after rails db:create

screenshot of text

Lost connection to MySQL server at 'reading initial communication packet', syste      m error: 0
Couldn't create 'qpixel_dev' database. Please check your configuration.
rails aborted!
Mysql2::Error::ConnectionError: Lost connection to MySQL server at 'reading init      ial communication packet', system error: 0
/usr/share/rvm/gems/ruby-2.6.6/gems/mysql2-0.5.3/lib/mysql2/client.rb:90:in `con      nect'
/usr/share/rvm/gems/ruby-2.6.6/gems/mysql2-0.5.3/lib/mysql2/client.rb:90:in `ini      tialize'
/usr/share/rvm/gems/ruby-2.6.6/gems/activerecord-5.2.6/lib/active_record/connect      ion_adapters/mysql2_adapter.rb:22:in `new'
/usr/share/rvm/gems/ruby-2.6.6/gems/activerecord-5.2.6/lib/active_record/connect      ion_adapters/mysql2_adapter.rb:22:in `mysql2_connection'
/usr/share/rvm/gems/ruby-2.6.6/gems/activerecord-5.2.6/lib/active_record/connect      ion_adapters/abstract/connection_pool.rb:830:in `new_connection'
/usr/share/rvm/gems/ruby-2.6.6/gems/activerecord-5.2.6/lib/active_record/connect      ion_adapters/abstract/connection_pool.rb:874:in `checkout_new_connection'
/usr/share/rvm/gems/ruby-2.6.6/gems/activerecord-5.2.6/lib/active_record/connect      ion_adapters/abstract/connection_pool.rb:853:in `try_to_checkout_new_connection'
/usr/share/rvm/gems/ruby-2.6.6/gems/activerecord-5.2.6/lib/active_record/connect      ion_adapters/abstract/connection_pool.rb:814:in `acquire_connection'
/usr/share/rvm/gems/ruby-2.6.6/gems/activerecord-5.2.6/lib/active_record/connect      ion_adapters/abstract/connection_pool.rb:538:in `checkout'
/usr/share/rvm/gems/ruby-2.6.6/gems/activerecord-5.2.6/lib/active_record/connect      ion_adapters/abstract/connection_pool.rb:382:in `connection'
/usr/share/rvm/gems/ruby-2.6.6/gems/activerecord-5.2.6/lib/active_record/connect      ion_adapters/abstract/connection_pool.rb:1033:in `retrieve_connection'
/usr/share/rvm/gems/ruby-2.6.6/gems/activerecord-5.2.6/lib/active_record/connect      ion_handling.rb:118:in `retrieve_connection'
/usr/share/rvm/gems/ruby-2.6.6/gems/activerecord-5.2.6/lib/active_record/connect      ion_handling.rb:90:in `connection'
/usr/share/rvm/gems/ruby-2.6.6/gems/activerecord-5.2.6/lib/active_record/tasks/m      ysql_database_tasks.rb:6:in `connection'
/usr/share/rvm/gems/ruby-2.6.6/gems/activerecord-5.2.6/lib/active_record/tasks/m      ysql_database_tasks.rb:14:in `create'
/usr/share/rvm/gems/ruby-2.6.6/gems/activerecord-5.2.6/lib/active_record/tasks/d      atabase_tasks.rb:119:in `create'
/usr/share/rvm/gems/ruby-2.6.6/gems/activerecord-5.2.6/lib/active_record/tasks/d      atabase_tasks.rb:139:in `block in create_current'
/usr/share/rvm/gems/ruby-2.6.6/gems/activerecord-5.2.6/lib/active_record/tasks/d      atabase_tasks.rb:316:in `block in each_current_configuration'
/usr/share/rvm/gems/ruby-2.6.6/gems/activerecord-5.2.6/lib/active_record/tasks/d      atabase_tasks.rb:313:in `each'
/usr/share/rvm/gems/ruby-2.6.6/gems/activerecord-5.2.6/lib/active_record/tasks/d      atabase_tasks.rb:313:in `each_current_configuration'
/usr/share/rvm/gems/ruby-2.6.6/gems/activerecord-5.2.6/lib/active_record/tasks/d      atabase_tasks.rb:138:in `create_current'
/usr/share/rvm/gems/ruby-2.6.6/gems/activerecord-5.2.6/lib/active_record/railtie      s/databases.rake:29:in `block (2 levels) in <top (required)>'
/usr/share/rvm/gems/ruby-2.6.6/gems/railties-5.2.6/lib/rails/commands/rake/rake_      command.rb:23:in `block in perform'
/usr/share/rvm/gems/ruby-2.6.6/gems/railties-5.2.6/lib/rails/commands/rake/rake_      command.rb:20:in `perform'
/usr/share/rvm/gems/ruby-2.6.6/gems/railties-5.2.6/lib/rails/command.rb:48:in `i      nvoke'
/usr/share/rvm/gems/ruby-2.6.6/gems/railties-5.2.6/lib/rails/commands.rb:18:in `      <top (required)>'
/root/qpixel/bin/rails:9:in `require'
/root/qpixel/bin/rails:9:in `<top (required)>'
/usr/share/rvm/gems/ruby-2.6.6/gems/spring-2.1.1/lib/spring/client/rails.rb:28:i      n `load'
/usr/share/rvm/gems/ruby-2.6.6/gems/spring-2.1.1/lib/spring/client/rails.rb:28:i      n `call'
/usr/share/rvm/gems/ruby-2.6.6/gems/spring-2.1.1/lib/spring/client/command.rb:7:      in `call'
/usr/share/rvm/gems/ruby-2.6.6/gems/spring-2.1.1/lib/spring/client.rb:30:in `run      '
/usr/share/rvm/gems/ruby-2.6.6/gems/spring-2.1.1/bin/spring:49:in `<top (require      d)>'
/usr/share/rvm/gems/ruby-2.6.6/gems/spring-2.1.1/lib/spring/binstub.rb:11:in `lo      ad'
/usr/share/rvm/gems/ruby-2.6.6/gems/spring-2.1.1/lib/spring/binstub.rb:11:in `<t      op (required)>'
/root/qpixel/bin/spring:13:in `require'
/root/qpixel/bin/spring:13:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.
Why should this post be closed?

0 comment threads

Post
+3
−0

You forgot to turn on mysql.

sudo systemctl enable mysql

systemctl doesn't work for every distro. If your system doesn't have systemctl then, you have to use service

sudo service mysql enable

Sometimes only enabling mysql service isn't helpful. Then, you have to login to mysql once.

mysql -u root -p

It will request you to enter password. Then, enter your password. Then, you can exit if you want. Then, try creating database again.

rails db:create
History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.

2 comment threads

nothing change ! I try everthing. (15 comments)
installation (3 comments)
nothing change ! I try everthing.
Gate_sprit‭ wrote over 3 years ago

nothing change ! I try everthing.

deleted user wrote over 3 years ago · edited over 3 years ago

You are keep repeating the same thing without showing the error every single time. At first, try to build it in your own machine (Ubuntu) (don't directly push to hosting(server)). https://collab.codidact.org/posts/280451

Gate_sprit‭ wrote over 3 years ago · edited over 3 years ago

Mysql2::Error: Access denied for user 'root'@'localhost' /usr/share/rvm/gems/ruby-2.6.6/gems/mysql2-0.5.3/lib/mysql2/client.rb:90:in `connect'

I search, found https://stackoverflow.com/questions/24009416/i-cant-run-bundle-update-because-of-mysql2-gem https://stackoverflow.com/questions/2672756/error-creating-rails-db-using-rake-dbcreate/2676675

deleted user wrote over 3 years ago · edited over 3 years ago

According to me, and this answer, your password is wrong. If not than it may be helpful also.

See it also https://stackoverflow.com/a/6887688/16241416

deleted user wrote over 3 years ago

My next suggestion is, If you aren't familiar with Ruby-on-rails than don't use qpixel. Ruby-on-rails isn't easier to understand. You can understand PHP, NodeJS by taking look at them. But, you won't understand how they are linked one file to another one. If you want you can watch the tutorial

Gate_sprit‭ wrote over 3 years ago

I found some useful links, I can't understand anything ! https://github.com/brianmario/mysql2/issues/1072 can you help me to fix authentication issue. I'm using my local server password, showing 'root'@ ' localhost'?

deleted user wrote over 3 years ago

You have to set password manually mysql_secure_installation;.

Gate_sprit‭ wrote over 3 years ago

I change it, nothing work

deleted user wrote over 3 years ago · edited over 3 years ago

Are you sure? :thinking: It asks for password when you execute mysql_secure_installation

Enter current password for root (enter for none): 
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
Gate_sprit‭ wrote over 3 years ago

I change my password to admin, nothing works. then change IP address on config/database.yml to 'localhost' work, I'm stuck at creating Community.create(name: 'Dev Community', host: 'localhost:3000') host is my domain name or my IP ?

deleted user wrote over 3 years ago

At first, run rails s then create an account manually by clicking on sign up... Then, submit. Simply, mail won't be sent. That's why you have to run the command Community.create(name: 'Dev Community', host: 'localhost:3000'). At first, rails c then, that command...

Skipping 1 deleted comment.

Gate_sprit‭ wrote over 3 years ago · edited over 3 years ago

after 'rails s' nothing

deleted user wrote over 3 years ago · edited over 3 years ago

What nothing? What did you mean? In your last comment, I think you had executed rails c then executed that command. rails s is used for running live server. After executing rails s visit http://localhost:3000/

Gate_sprit‭ wrote over 3 years ago

I change localhost:3000 to bimberspot.com

Gate_sprit‭ wrote over 3 years ago

=> Booting Puma => Rails 5.2.6 application starting in development => Run rails server -h for more startup options Puma starting in single mode...

  • Version 4.3.8 (ruby 2.6.6-p146), codename: Mysterious Traveller
  • Min threads: 0, max threads: 16
  • Environment: development
  • Listening on tcp://127.0.0.1:3000
  • Listening on tcp://[::1]:3000 Use Ctrl-C to stop