Connecting to the Server Using URI-Like Strings or Key-Value Pairs The previous examples assume that connections require a password. With interactive clients, the specified user’s password is requested at the login prompt. If the user account has no password (which is insecure and not recommended), or if socket peer-credential authentication is in use (for example, with Unix socket connections), you must explicitly specify in the connection string that no password is being provided and the password prompt is not required. To do this, place a  :  after the  user_name  in the string but do not specify a password after it. For example: mysqlx:// user_name :@localhost In MySQL Shell and some MySQL Connectors which implement X DevAPI, you can specify a connection to MySQL Server using key-value pairs, supplied in language-natural constructs for the implementation. For example, you can supply connection parameters using key-value pairs as a JSON object in JavaScript, or as a dictionary in Python. Regardless of the way the key-value pairs are supplied, the concept remains the same: the keys as described in this section can be assigned values that are used to specify a connection. You can specify connections using key-value pairs in MySQL Shell’s  shell.connect() method or InnoDB Cluster’s  dba.createCluster()  method, and with some of the MySQL Connectors which implement X DevAPI. Generally, key-value pairs are surrounded by  {  and  }  characters and the  ,  character is used as a separator between key-value pairs. The  :  character is used between keys and values, and strings must be delimited (for example, using the  ’  character). It is not necessary to percent encode strings, unlike URI-like connection strings. A connection specified as key-value pairs has the following format: {  key :  value ,  key :  value , ...} The parameters you can use as keys for a connection are described at Base Connection Parameters. If no password is specified in the key-value pairs, which is recommended, interactive clients prompt for the password. The following examples show how to specify connections using key-value pairs with the user name  ’ user_name ’ . In each case, the password is prompted for. {user:’ user_name ’, host:’localhost’, port:33065} {user:’ user_name ’, host:’localhost’, port:3333} •An X Protocol connection using a socket. {user:’ user_name ’, socket:’ /path/to/socket/file ’} 373 •An optional schema can be specified, which represents a database. •An X Protocol connection to a remote server instance, using a host name, an IPv4 address, and an IPv6 address. •A classic MySQL protocol connection to a local server instance listening at port 3333. •An X Protocol connection to a local server instance listening at port 33065. mysql:// user_name @198.51.100.2:3306/world%5Fx?\ tls-versions=[TLSv1.2,TLSv1.3]&tls-ciphersuites=[TLS_DHE_PSK_WITH_AES_128_\ GCM_SHA256, TLS_CHACHA20_POLY1305_SHA256] {user:’ user_name ’, host:’server.example.com’} {user:’ user_name ’, host:198.51.100.14:123} {user:’ user_name ’, host:[2001:db8:85a3:8d3:1319:8a2e:370:7348]} Connecting Using Key-Value Pairs