haiwen / seafile

High performance file syncing and sharing, with also Markdown WYSIWYG editing, Wiki, file label and other knowledge management features.
http://seafile.com/
Other
12.25k stars 1.54k forks source link

setup-seafile-mysql.sh auto fails with wrong host #1688

Closed thanosme closed 8 years ago

thanosme commented 8 years ago

Hello! While using seafile server 5.1.3 and running ./setup-seafile-mysql.sh auto

with

./setup-seafile-mysql.sh auto -n name -i example.com -e 0 -o 172.17.0.4 -t 3306 -u seafuser -w seafuser -q 172.17.0.4 -r 1234 -c ccnetdb -s seafiledb -b seahubdb

using a remote mysql database, the script failed as it tried to connect to a local mysql server. This is the error that I am getting.

  Checking python module: setuptools ... Done.
  Checking python module: python-imaging ... Done.
  Checking python module: python-mysqldb ... Done.

verifying password of user root ...  done

---------------------------------
This is your configuration
---------------------------------

    server name:            name
    server ip/domain:       example.com

    seafile data dir:       /seafile/seafile-data
    fileserver port:        8082

    database:               create new
    ccnet database:         ccnetdb
    seafile database:       seafiledb
    seahub database:        seahubdb
    database user:          seafuser

Generating ccnet configuration ...

done
Successly create configuration dir /seafile/ccnet.
Generating seafile configuration ...

Done.
done
Generating seahub configuration ...

----------------------------------------
Now creating seahub database tables ...

----------------------------------------

Error: Failed to connect to mysql database seahubdb: Access denied for user 'seafuser'@'172.17.0.6' (using password: YES)

However the script has successfully created the databases as well as the user in the remote mysql server. Looking inside conf/ccnet.conf, conf/seafile.conf and conf/seahub_settings.py I see that the remote mysql is declared. Might this be a bug or something me doing wrong from my end?

shoeper commented 8 years ago

Does the created SQL user have permisssion on Seafile databases?

thanosme commented 8 years ago

It has all all privileges except grant. Also if you notice at the end of the error I posted it says

Access denied for user 'seafuser'@'172.17.0.6' (using password: YES)

which is the local ip.

shoeper commented 8 years ago

Looks like it has been fixed in https://github.com/haiwen/seafile/pull/1689/files

thanosme commented 8 years ago

Nice!