![]() ![]() |
|
![]() ![]() ![]() ![]() |
|
![]() |
![]() 6.3 Connecting to the MySQL server
MySQL client programs generally require that you specify connection
parameters when you want to access a MySQL server: the host you want
to connect to, your user name and your password. For example, the
shell> mysql [-h host_name] [-u user_name] [-pyour_pass]
Alternate forms of the
Note: Specifing a password on the command line is not secure!
Any user on your system may then find out your password by typing a command
like:
Thus, for a Unix user shell> mysql -h localhost -u joe shell> mysql -h localhost shell> mysql -u joe shell> mysql Other MySQL clients behave similarly. On Unix systems, you can specify different default values to be used when you make a connection, so that you need not enter them on the command line each time you invoke a client program. This can be done in a couple of ways:
If connection parameters are specified in multiple ways, values specified on the command line take precedence over values specified in configuration files and environment variables, and values in configuration files take precedence over values in environment variables. |