After MySQL has been successfully installed, the base tables have been initialized, and the server has been started, you can verify that all is working as it should via some simple tests. Note that all these commands should be run from your UNIX or Windows command prompt. I am assuming here that you are running them from your MySQL installation directory (as per the examples in the section “Installing and Configuring MySQL,” this will be either /usr/local/mysql in UNIX or c:\program files\mysql in Windows). Use the mysqladmin Utility to Obtain Server Status The mysqladmin utility is usually located in the bin subdirectory of your MySQL installation. You can execute it by changing to that directory and executing the following command:
You should see something resembling the output shown in Figure 22.
Connect to the Server Using the MySQL Client, and Execute Simple SQL Commands The MySQL client that ships with the MySQL distribution is named, funnily enough, mysql. Fire it up from your command prompt by switching to the bin directory of your MySQL installation and typing
You should be rewarded with a mysql> prompt. At this point, you are connected to the MySQL server and can begin executing SQL commands or queries. Here are a few examples, with their output:
blog comments powered by Disqus |