¨MySQL is a database server
¨mysql (sometimes referred to as the “terminal monitor” or just “monitor”) is an interactive program that enables you to connect to a MySQL server (which contains databases.
¨In a database we have data (/data tables)
¨How we can evaluate/interpret those data?
¨So, we use queries to view results according to our needs.
Connecting and Disconnecting from the server
¨To connect to the server, you will usually need to provide a MySQL user name when you invoke mysql and, most likely, a password
¨If the server runs on a machine other than the one where you log in(localhost), you will also need to specify a host name.
¨Once you know the proper parameters, you should be able to connect like this:
shell> mysql –h host -u user -p
Enter password: ********
¨host and user represent the host name where your MySQL server is running and the user name of your MySQL account
¨If you are logging in on the same machine that MySQL is running on, you can omit the host, and simply use the following:
shell> mysql -u user –p
¨Some MySQL installations permit users to connect as the anonymous (unnamed) user to the server running on the local host. If this is
the case on your machine, you should be able to connect to that server by invoking mysql without any options:
shell> mysql
No comments:
Post a Comment