## 事象 [[sqls.nvim]]が正しくインストールされている状態で `test.sql` を作成し、以下を記載。 ```sql SELECT * FROM ``` ここでテーブル名の補完が出てほしいが何も表示されない。 ### 接続設定ファイル `~/.config/sqls/config.yml` は以下。 ```yaml lowercaseKeywords: false connections: - alias: mysql-sample driver: mysql proto: tcp user: user password: password host: localhost port: 13306 dbName: mydb ``` [[Lazysql]] では `mysql://user:passwoord@localhost:13306/mydb` の接続情報で問題ないため、各種パラメータは間違ってなさそう。 ### エラー状況 `:SqlsExecuteQuery` を実行すると以下のエラーが表示される。 ```error sqls: database connection is not open ``` さらに `SqlsSwitchConnection` で1つ目のconnectionを選択すると以下のエラーが表示される。 ```error sqls: cannot ping to database, Error 1045 (28000): Access denied for user 'user'@'172.18.0.1' (using password: NO) ``` ### 環境 | 対象 | バージョン | | ------------- | ------------------------ | | [[Neovim]] | v0.10.3 | | [[MySQL]] | 8.4.3-1.el9 | | [[sqls]] | 0.2.28 | | [[sqls.nvim]] | a514379 | | [[Docker]] | 27.5.0, build a187fa5 | | [[Ubuntu]] | 24.04.1 LTS (in [[WSL]]) | ## 原因 パスワードのキーが間違っていた。`password` ではなく `passwd`。 ## 解決方法 `~/.config/sqls/config.yml` の以下を修正する。 ```diff proto: tcp user: user - password: password + passwd: password host: localhost port: 13306 ``` ## 参考 - [GitHub - sqls-server/sqls: SQL language server written in Go.](https://github.com/sqls-server/sqls?tab=readme-ov-file#configuration-file-sample)