Home  >  Q&A  >  body text

Connect to MySQL/MariaDB from command line client using URI connection string?

<p>A database connection string given the URI pattern: </p> <pre class="brush:php;toolbar:false;">mysql://<user>:<pass>@<host>:<port>/<database></pre> <p>Is there a way to use this string directly in the MySQL command line client without breaking it into the familiar <code>mysql -u <user> -h <host> -p ... </code> Format? < /p> <p>I found some discussion about this here, but the suggested option <code>--uri</code> does not exist in my client (mysql Ver 15.1 Distrib 10.11.2-MariaDB). </p>
P粉545218185P粉545218185417 days ago505

reply all(1)I'll reply

  • P粉985686557

    P粉9856865572023-08-31 11:40:01

    You must use mysqlsh (mysql shell) instead of mysql.

    Use the --uri=<您的连接字符串> option.

    https://dev.mysql.com /doc/mysql-shell/8.0/en/mysqlsh.html#option_mysqlsh_uri

    reply
    0
  • Cancelreply