-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Can't connect to MySQL via TCP, I need to use UNIX socket #11707
Comments
Looking at your logs it looks like the only SQL statement that is run is |
Do you mean running it in MariaDB shell? I get the following error: MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| gitea-db |
| information_schema |
| mysql |
| performance_schema |
+--------------------+
8 rows in set (2.531 sec)
MariaDB [(none)]> PING DATABASE mysql;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'PING DATABASE mysql' at line 1 If I remove the install lock and try to setup the database from the web gui I get the error I encountered the first time I installed Gitea:
|
Tried #9279, I can use MySQL if I set the sock binding [mysqld]
socket = /var/run/mysqld/mysqld.sock in HOST = /var/run/mysqld/mysqld.sock
;HOST = 127.0.0.1:3306 Why? |
I suspect you need to set: [database]
NAME=gitea-db
... in your app.ini |
This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions. |
I suspect the issue is the lack of permission to connect over TCP. I note that you said you ran: GRANT ALL ON gitea-db.* TO 'gitea'@'localhost' IDENTIFIED BY 'XXXXXX' WITH GRANT OPTION;
FLUSH PRIVILEGES;
EXIT; This does not necessarily give access to tcp connection over 127.0.0.1 See https://stackoverflow.com/questions/19712307/mysql-localhost-127-0-0-1 I suggest you try: GRANT ALL ON gitea-db.* TO 'gitea'@127.0.0.1 IDENTIFIED BY 'XXXXXX' WITH GRANT OPTION;
FLUSH PRIVILEGES;
EXIT; I appreciate that |
I noticed the same error for other users. This answer from the link you posted helped me, I had Thank you |
Gitea version (or commit ref):
Gitea version 1.11.0 built with GNU Make 4.3, go1.13.8 : bindata, sqlite, pam
Git version:
git 2.26.2-1
Operating system:
Linux 5.4.40-1-ARCH #1 SMP PREEMPT Thu May 14 01:48:56 UTC 2020 armv7l GNU/Linux
Database (use
[x]
):mariadb 10.4.13-1
Can you reproduce the bug at https://try.gitea.io:
Description
I tried to move to MySQL after the some time using SQLite. I did
On the DB shell,
Again in bash
mysql -u gitea -p gitea-db < gitea-db.sql
The command exited without errors. I stopped Gitea and changed in
app,ini
from thisto this
When I tried to restart Gitea system service, it failed with result 'exit-code'.
gitea.log
reports:`gitea.log`
The text was updated successfully, but these errors were encountered: