Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8908695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:14:56+00:00 2026-06-15T03:14:56+00:00

I am standing up a new Ubuntu server running MySQL. I have Capistrano set

  • 0

I am standing up a new Ubuntu server running MySQL. I have Capistrano set up on my development server and am trying to deploy:cold after running deploy:setup. After the deploy script tries to run

executing "cd /home/adm1n/www/knowit/releases/20121112152400 && bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile"

I keep getting this message:

Rake Aborted!
Access denied for user 'specialusername'@'localhost' (using password: YES)
Tasks: TOP => environment

I have ‘specialusername’ created in my database on the mysql server for both localhost and %.
I removed the empty user ‘ ‘ @ localhost row in the user database.
I have added the IP address of the server to my my.cnf file and commented out the 127.0.0.1 line.

Here is my deploy.rb file for production:

production:
adapter: mysql2
encoding: utf8
reconnect: false
database: mydatabasename
username: specialusername
password: crazypassword
socket: /tmp/mysql.sock
pool: 5
timeout: 5000

I think that I may not be understanding how this works. On my Site5 server I have never had to specify which host I was accessing mysql from. But in all my reading it seems that I must specify a specific user@hostname. This makes it a little difficult if I am deploying from many different locations around the country as I travel. OR do I merely need to use the hostname of my laptop regardless of my current IP address? Thanks for any insight and solutions you can provide. I have not found any articles that have provided me precisely what I need to fix this issue.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T03:14:57+00:00Added an answer on June 15, 2026 at 3:14 am

    There are two ways to connect to a MySQL server.

    First, using a UNIX socket, such as /tmp/mysql.sock, in which case there is no “host”, so authentication uses username@localhost. This will work only with connection from the same machine.

    Second, using a TCP/IP connection. In this case, the server listen to a specific port on the box running the database, and the way to connect to it is to provide a host + port number. The port number can be optional (the default will be used), and host can be given by hostname or by ip address. This allows to connect locally or remotely.

    Note: I have no way to actually verify this (no access to your server), so below is just a possible explanation …

    In mysql -u knowitdbadmin -p -h192.168.0.50, a host (-h) is given, so TCP/IP is used, causing authentication to use username@hostname or username@% rules, but this will not use username@localhost.

    In mysql -u knowitdbadmin -p, no host (-h) is given, so the default UNIX socket is used, causing authentication to use username@localhost (and therefore fails).

    If you want to disable access using a UNIX socket (/tmp/mysql.sock) and username@localhost, and always use a TCP/IP connection, do it all the way:
    * remove grants to username@localhost (done)
    * always specify a host/IP (+ port) in configuration files from your application.

    I think the problem is with:

    socket: /tmp/mysql.sock
    

    try using a hostname + port number instead.

    As a side note, if you somehow have SQL access to the database itself, starting with 5.5, a new table performance_schema.host_cache will show you all the reasons a connection is failing, which saves a lot of time when troubleshooting things like this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've added a handful of new builds to a long standing CruiseControl.Net setup. Everything
I have a long standing doubt. Could someone please tell me whether method overloading
I have a long standing problem: at work we're using mercurial as a DSCM,
I have a long-standing application that I'm normally able to compile equally well from
I have to work with a string standing for a keystroke (for instance A,
Here is my problem. I have a chipmunk's rigid body (a soda can standing
I'm used to web development using LAMP, PHP5, MySQL plus NetBeans with Xdebug. Now
I have a List of Customers List<Customers> cust = new List<Customers>(); cust.Add(new Customers(){ID=1, Name=Sam,
We have a long standing issue in our bug tracking system about the dreaded
I'm trying to clean up a long-standing bad habit in coding: Writing widgets to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.