can't connect sql instance

121 views
Skip to first unread message

Tim

unread,
Mar 10, 2020, 8:49:08 AM3/10/20
to Google Cloud SQL discuss
Hi everyone,

There is problem connect to sql instance, I did early action in gcp...

create sql instance
restore personal instance to sql
use service credential to login

In the result to connect to db there is error, I don't well know the current service. Let me know who can help me to this matter, thank.

Connecting to database with SQL user [sqlserver].********************************************************************************
Python 2 is deprecated. Upgrade to Python 3 as soon as possible.

To suppress this warning, create an empty ~/.cloudshell/no-python-warning file.
The command will automatically proceed in  seconds or on any key.
********************************************************************************
Password:
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/local/lib/python2.7/dist-packages/mssqlcli/main.py", line 117, in <module>
    main()
  File "/usr/local/lib/python2.7/dist-packages/mssqlcli/main.py", line 110, in main
    run_cli_with(mssqlcli_options)
  File "/usr/local/lib/python2.7/dist-packages/mssqlcli/main.py", line 43, in run_cli_with
    from mssqlcli.mssql_cli import MssqlCli
  File "/usr/local/lib/python2.7/dist-packages/mssqlcli/mssql_cli.py", line 18, in <module>
    from prompt_toolkit.shortcuts import PromptSession, CompleteStyle
ImportError: cannot import name PromptSession

David (Cloud Platform Support)

unread,
Mar 10, 2020, 12:43:57 PM3/10/20
to Google Cloud SQL discuss

Hello,


Are you using the Cloud Shell? 


Because if you are, there is a known Issue while connecting from it possibly related to the python runtime or environment variable. Could you please try connecting from a Compute Engine instance? For now, I would recommend you to follow this Issue Tracker link as our Cloud Shell engineering team is aware of this issue and currently investigating it.

Danial Ameen

unread,
Jun 5, 2020, 10:36:09 AM6/5/20
to Google Cloud SQL discuss
i am also facing the same problem for create sql instance
restore personal instance to sql
use service credential to login for my  store best ninjasmerchstore .. thanks for the solution...


On Tuesday, March 10, 2020 at 5:49:08 PM UTC+5, Tim wrote:
Hi everyone,

There is problem connect to sql instance, I did early action in gcp...

create sql instance
restore personal instance to sql
use service credential to login

In the result to connect to db there is error, I don't well know the current service. Let me know who can help me to this matter, thank.

Connecting to database with SQL user [sqlserver].********************************************************************************
Python 2 is deprecated. Upgrade to Python 3 as soon as possible.

Katayoon (Cloud Platform Support)

unread,
Jun 5, 2020, 3:00:07 PM6/5/20
to Google Cloud SQL discuss
Hi Danial,

If you are receiving the same issue reported in the public issue tracker, I recommend to star the ticket for further updates on it.


Reply all
Reply to author
Forward
0 new messages