Web site management

140 Part II . SQL Essentials Figure 8-9: Use the -h switch to connect to another MySQL server or leave it blank to connect to the local machine. If you want to set a default host other than localhost without having to specify the -h switch every time you can set the host inside the configuration file, see the discussion of environment variables (later in this chapter) for details on how to set and change default variables for the MySQL CLI. Any host specified in a configuration file is overridden if you specify another -h on the command line. Specifying the database The MySQL CLI enables you to specify the database to use without the addition of any switches to the command line. The command expects the database to be specified as the last part of the command line. For example, to use a database called inventory, simply add it to the command at the end, like this: mysql -p -u suehring inventory If no database is specified on the command line (assuming you have access privileges), you return automatically to the MySQL CLI in interactive mode but not connected to any database. To connect and use a database, issue the connect statement. In Figure 8-10, I connect to the MySQL server without specifying a database. I can then connect to a database by using the connect statement. If you want to specify the database at a location other than the end of the command line, you can use the -Dor –database=switches. To set a default database for MySQL to use upon startup, add a database= to the MySQL configuration file, see the section on Environment Variables in this chapter for details on how to set and change default variables for the MySQL CLI.
Note: If you are looking for high quality webhost to host and run your jsp application check Vision christian web host services

Leave a Reply