'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)' in debian6 - linux

Well, recently I tried to install mysql_cluster on debian6. At first it works well, but when I try to install mysql_cluster multiply, an error occurs saying, that I cannot login as root anymore. I was trying to modify the pwd of root with the command:
/usr/local/mysql/bin/mysqladmin -u root password '654321'
But it turned out with wrong info as:
/usr/local/mysql/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket
'/var/run/mysqld/mysqld.sock' (2)'
I tried everything I can to solve this problem but failed. I was attemped to run the command:
find / -name *.sock -type s
but I just cannot find the file mysqld.socks anywhere. As reference I had tried every method from this article.
All the methods failed, that I've tried so far.

Related

Errors setting up Ruby development environment: nodejs not found, could not connect to server

I'm a new developer-in-training attempting to set up my Ruby development environment on a Windows machine using Ubuntu. I'm following the instructions here:
https://gorails.com/setup/windows/10
I've made it to the last few steps of the process, which is where I'm started to get errors:
# Navigate to the C: drive on Windows. Do this every time you open the Linux console.
cd /mnt/c
# Create a code directory at C:\code for your Rails apps to live (You only need to do this once)
mkdir -p code
#### If you want to use Postgres
# Note that this will expect a postgres user with the same username
# as your app, you may need to edit config/database.yml to match the
# user you created earlier
rails new myapp -d postgresql
#### or if you want to use SQLite (not recommended)
# rails new myapp
#### Or if you want to use MySQL
# rails new myapp -d mysql
# Then, move into the application directory
cd myapp
# If you setup MySQL or Postgres with a username/password, modify the
# config/database.yml file to contain the username/password that you specified
# Create the database
rake db:create
rails server
On the step to set up Postgres:
rails new myapp -d postgresql
I receive this error about setting up nodejs:
/home/event/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/railties-6.0.1/lib/rails/app_loader.rb:53: warning: Insecure world writable dir /home/event/.rbenv/versions/2.6.5 in PATH, mode 040777
sh: 1: node: not found
sh: 1: nodejs: not found
Node.js not installed. Please download and install Node.js https://nodejs.org/en/download/
Even after I go to the URL provided and install NodeJS, that error still shows up when I attempt to repeat the process. Is this just a matter of it not existing in the correct path and I need to relocate it?
Also, I've attempted to proceed with the other steps despite that error. When I enter this command, the second last one in the article referenced above:
rake db:create
I receive this error:
could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
Couldn't create 'myapp_development' database. Please check your configuration.
rake aborted!
ActiveRecord::NoDatabaseError: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
Caused by:
PG::ConnectionBad: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
Tasks: TOP => db:create
(See full trace by running task with --trace)
I've searched around about this with little success, and attempted to decipher what the error messages mean; but at my current level of knowledge it just seems beyond me. Appreciate any insight anyone has to share on this!

Cant access mongodb shell and mongo errored

I installed mongo following this tutorial with the exception that I ran the service with pm2 because I can actually tell what I am doing with pm2.
I then have been trying to follow this tutorial however I cant even access the shell.
I have tried the following commands and none of them work:
./bin/mongo causes a file not found error whether it is in my project file or in the /var/lib/mongodb folder where the db is supposedly "installed"
Additionally
mongo localhost:27017 (or just mongo)
causes
MongoDB shell version: 3.2.19
connecting to: test
2018-02-12T20:15:59.009+0000 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: errno:111 Connection refused
2018-02-12T20:15:59.009+0000 E QUERY [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed :
connect#src/mongo/shell/mongo.js:229:14
#(connect):1:6
exception: connect failed
My log file (from /var/log/mongodb/mongod.log) can be found here. I do have some confusion about it:
Why did it shut down
Why is the host=GraphicsApplications? That is an old folder that I have since deleted on my machine. It was my first attempt at getting this going but back then I was hosting my DB with mlab. The folder/name it lists no longer exists. For some reason though the start of every line in terminal says root#GraphicsApplications. Not sure where that name came from... perhaps I named the box that?
Ultimately I dont know exactly how that tutorial had me install mongodb. Sure I installed the packages and everything but I dont feel like I ever really created anything if that makes sense.
It is worth noting that pm2 does show the status of the mongod app as "errored" currently but I am not sure why or for how long it stayed up.
I am just trying to get my database running on my own Linux box rather than mlab. I had everything working with mlab but now want to be hosting my db on localhost.
Looking in the logs it says that your hostname is host=GraphicsApplications
But in your actual hosts file you have 127.0.1.1 GraphicsApplications GraphicsApplications
Edit this line in your hosts file to be just 127.0.1.1 GraphicsApplications
Then save the file and rerun mongod. Hopefully that should do it.
Regarding file not found:
Try running from the cmd line:
which mongo
If that doesn’t show any result then the mongo binariesarn’t in your PATH env variable, in which case try
find / -name “mongo*”
That should then show where your mongo binaries have been installed.
If you know where the binaries are installed then running:
./bin/mongo
Presumes you’re in the mongo home dir, so you would need to run;
/var/lib/mongodb/bin/mongo
Regarding connection refused
could be an iptables rule, try disabling it and starting mongo
sudo ufw disable
hostfile
Comment out this
127.0.1.1 GraphicsApplications
And change/add this
127.0.0.1 localhost localhost.localdomain
As per : https://jira.mongodb.org/plugins/servlet/mobile#issue/SERVER-20952

Heroku Login cmd permission issue for Windows 10

I installed heroku cli.
$ heroku --version
heroku-cli/6.14.36-15f8a25 (windows-x64) node-v8.7.0
Started cmd.exe as admin
$ heroku login (asked me for username and password)
After I provided the username and password. I get the following error:
! EACCES: connect EACCES 34.234.38.27:443
I tried using gitbash to login in heroku. I get the same error message if I try same thing in git bash using the following cmd:
winpty heroku login
I have looked everywhere I could. Most places have closed the tickets but there is no solution anywhere. I also tried deleting the heroku folder from appdata/local/ but that also didn't help. I know its permission issue. I get a better error message when I try
$ heroku update
heroku-cli: Updating plugins... done
! Get https://cli-assets.heroku.com/branches/v6/manifest.json: dial tcp 52.84.64.82:443: connectex: An attempt was made to access a socket in a way forbidden by its access permissions.
I want to host a small NodeJS app for free. What are my other options because if I have to spend so much time just deploying then maybe it is not an option.
maybe your problem is the firewall or the antivirus, add the exception for the address that shows you (34.234.38.27:443), and do the test. Also check your antivirus if it is not blocking you heroku cli, and always run in administrator mode
You can also do the following. Enable debugging during login. Make sure to redact your password from the output before sending it to support! Enable it by running set HEROKU_DEBUG=true; set HEROKU_DEBUG_HEADERS=1; heroku login on Windows to get more information.
Good luck with your app my friend!

ec2 instance access failed due to change in owner

When I login to the server, but 22 is already open for all upcoming connections still getting error as below,
ssh Server_Name
ssh: connect to host Server-IP port 22: Connection refused
I misleadingly change the the owner of the system and change root privileges with jenkins. So, right now I could not able to log into the system and port 22 is closed it's throwing the error.
I understood the error issue occurred because of wrong fstab file and wrong editing to sshd conf(Not sure). And, the directory of authorized_keys been messed up. I tried this solution but not working
I tried accessing via public DNS, via private IP address, detaching and re-attaching volumes driver after attaching it to other instance(but, once I attached to it, I could not able to ssh into that instance), etc. but no luck. Also, tried login with Jenkins user still not working. But, jenkins is still running fine on the server and I could access the Jenkins Dashboard and run the shell onto my instance. But, if I try any sudo command, it shows sudo: effective uid is not 0, is sudo installed setuid root?
Build step 'Execute shell' marked build as failure
Questions
Is there any way to get back my instance port 22 running fine as before ?
Is there a way I can run the sudo commands using Jenkins user by creating the job(By running the shell) inside Jenkins ?
I could trace on the IP which clearly shows port 22 is closed and I could not do anything because of it. Thanks in advance.

Net::SSH::AuthenticationFailed: Authentication failed with an invalid user

Having an issue when executing 'knife ssh' command.
I've configured properly the SSH keys for remote connection so that seems to work fine when trying to connect manually doing: ssh root#myhost.domain.com cause it automatically gives me access to myhost.domain.com without request for a password.
After that, I tried to run the following knife command to execute a recipe in my remote machine but I'm getting this error:
# knife ssh -C 1 "tags:amx_host AND chef_environment:dev" "chef-client -o recipe[amx]" -i root_dev -x root
WARNING: Failed to connect to myhost.domain.com -- Net::SSH::AuthenticationFailed: Authentication failed for user root#myhost.domain.com#myhost.domain.com
Seems like knife is identifying an invalid user name root#myhost.domain.com which should be just root instead.
Please, does anyone have any clues on how can I avoid this error or why SSH is taking a wrong user: root#myhost.domain.com instead of just root?
Typo issue: was taking a non-existing identity key file: root-dev for the remote connection

Resources