Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error connecting to mysql database during installation #1362

Closed
2 of 7 tasks
ADmad opened this issue Mar 22, 2017 · 10 comments
Closed
2 of 7 tasks

Error connecting to mysql database during installation #1362

ADmad opened this issue Mar 22, 2017 · 10 comments
Labels
type/question Issue needs no code to be fixed, only a description on how to fix it yourself.

Comments

@ADmad
Copy link

ADmad commented Mar 22, 2017

  • Git version: v1.1.0
  • Operating system: ubuntu 16.04
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

When trying to install gitea i am getting the following error Database setting is not correct: dial tcp: missing port in address localhost. I used host localhost with proper credentials.

I also tried using host as localhost:3306 which results in error Database setting is not correct: dial tcp 127.0.0.1:3306: getsockopt: connection refused

@ADmad
Copy link
Author

ADmad commented Mar 22, 2017

After setting bind-address: 127.0.0.1 in mysql server config I was able to get the installation working with host localhost:3306.

Just using host localhost still gives the error message reported above. It's a bit strange specifying the port is necessary even though it's default port.

@ADmad ADmad closed this as completed Mar 22, 2017
@strk
Copy link
Member

strk commented Mar 22, 2017

Could anyone please reopen this ? We want people to be able to set Gitea to still use unix sockets to connect to mysql.

@ADmad
Copy link
Author

ADmad commented Mar 22, 2017

Reopening the issue on @strk's request.

@ADmad ADmad reopened this Mar 22, 2017
@muhfaris
Copy link
Contributor

muhfaris commented Dec 18, 2017

i try to run go-gitea through docker-compose, following the tutorial Installation with docker.
and get error as follow:

Database setting is invalid: dial tcp 127.0.0.1:3306: getsockopt: connection refused

change to localhost, not work

docker compose is running

     Name                   Command               State                   Ports                 
------------------------------------------------------------------------------------------------
gitea_db_1       docker-entrypoint.sh mysqld      Up      3306/tcp                              
gitea_server_1   /usr/bin/entrypoint /bin/s ...   Up      0.0.0.0:222->22/tcp,                  
                                                          0.0.0.0:3000->3000/tcp 

can you help me @ADmad @strk ?
thanks

@lunny
Copy link
Member

lunny commented Dec 20, 2017

@muhfaris you should map mysql port to 3306

@muhfaris
Copy link
Contributor

@lunny thanks for reply
but isn't work,
i try to change from localhost or 127.0.0.1 to ip address from db container.
to get ip from db container use command sudo docker-compose exec db ifconfig

@lunny lunny added the type/question Issue needs no code to be fixed, only a description on how to fix it yourself. label Dec 20, 2017
@Wilkolicious
Copy link

If you're using docker-compose, you need to reference the host as the service name from within your docker-compose.yml.

So if you copy-pasta'd the config from the instructions, your database will be at: db:3306.

If the database was started with the docker-compose setup as documented above please note that db must be used as the database hostname.

See: https://docs.gitea.io/en-us/install-with-docker/#install

@lafriks lafriks closed this as completed Jul 20, 2018
@ghost
Copy link

ghost commented Oct 10, 2018

I have installed this via docker and set my database to be gitea-database. I've referenced this as suggested as gitea-database:3306 in docker-compose.yaml.

When I run the install script I get the following error:

The database settings are invalid: dial tcp: lookup gitea-database on 127.0.0.11:53: no such host

Edit:

I had neglected to add my network to the database host. ignore this comment.

@tester0077
Copy link

tester0077 commented Aug 17, 2019

I have just run into the very same issue after an installation from a binary. Docker is installed, but I would expect that installing it directly would not involve it in any way.
FWIW, I am trying to install it on an OpenMediaVault machine using ShellInABox,
The signon says:
Linux MyNAS 4.19.0-0.bpo.2-amd64 #1 SMP Debian 4.19.16-1~bpo9+1 (2019-02-07) x86_64
\Neither localhost, nor 127.0.0.1 not the box's real IP address make any difference, other than in the response IP:port string
Curiously, the ShellInABox screen does not look like there were any errors, though I am not really sure what I should expect

@ElTimablo
Copy link

I'm running into this issue as well using docker-compose. I was able to get something to happen by passing it its own IP address, but that time the page timed out while the database churned in the background.

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/question Issue needs no code to be fixed, only a description on how to fix it yourself.
Projects
None yet
Development

No branches or pull requests

8 participants