See Section 6.1.2.1, “End-User Guidelines for Password Security”. This is more secure than giving the password on the command line, which might enable other users on your system to see the password line by executing a command such as ps. If you use -password or -p but do not specify a password value, the client program prompts you to enter the password. No space between -password= or -p and the password following it. If you use a -password or -p option and specify a password value, there must be Mysql -h localhost -u myname -ppassword mydbįor password options, the password value is optional: Examples: mysql -host=localhost -user=myname -password=password mydb To select a default database, add a database-name argument. To specify the host name and user name explicitly, as well as a password, supply appropriate options on the command line. Because there is no such argument, mysql selects no default database. Mysql, the first nonoption argument is taken as the name of the default database. No password is sent because neither -password nor -p is given. The default user name is ODBC on Windows or your Unix login name on Unix. On Unix, this has a special meaning, as described later. This command invokes mysql without specifying any explicit connection parameters: mysql The examples here use the mysql client program, but the principles apply to other clients such as Override default values as necessary using program options specified either on the command line or in an option file. Each connection parameter has a default value, but you can Section 6.2.22, “Troubleshooting Problems Connecting to MySQL”.įor a client program to connect to the MySQL server, it must use the proper connection parameters, such as the name of the host where the server is running and the user name and password of your MySQL account. For additional information if you are unable to connect, see Section 4.2.5, “Connecting to the Server Using URI-Like Strings or Key-Value Pairs”. For information on establishing connections using URI-like connection strings or key-value pairs, for clients such as MySQL Shell, see This section describes use of command-line options to specify how to establish connections to the MySQL server, for clients such as mysql or PHP TutorialPHP HOMEPHP IntroPHP InstallPHP SyntaxPHP VariablesPHP Echo / PrintPHP Data TypesPHP StringsPHP ConstantsPHP OperatorsPHP If.Else.4.2.4 Connecting to the MySQL Server Using Command Options
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2023
Categories |