Best web hosting
Chapter 8 . Command Line Interface (CLI) 137 How you start the MySQL CLI depends largely on what you want to do. To work with a database interactively, you have to supply credentials to establish a connection. Normally those credentials come in the form of a username and a password though they can include an optional name of the database you re working with, as well as the hostname (or IP address) of the server. In Figure 8-5, for example, I m connecting to the local server (localhost) as username suehringand telling the program to perform two tasks: Ask me for a password and connect me to the ecommerce server. Figure 8-5: Connecting as username suehring to the ecommerce database and specifying a password Cross-The examples throughout this chapter assume that the user account you re using Reference has sufficient access privileges to perform the operations. If this is not the case, consult Chapter 12 for a description of how to add a user account with specified privileges. Specifying the username When using mysqlin Linux, normally you need not add the -u(username) switch. If the -u username switch is not specified, the mysqlcommand uses the username from your environment variables. For that authentication to work, the MySQL server must have a user entry with correct privileges in its user table. In Figure 8-6, the -uswitch is not used, so MySQL grabs the username suehringfrom the environment variables. Because a user suehring exists in the MySQL database and has the proper privileges, I can connect to the database server after supplying the correct password.
Note: In case you are looking for affordable and reliable webhost to host and run your business application check Vision ftp web hosting services