8.5.3 Querying the MySQL database
There are many ways to query the MySQL database using the SELECT command. A basic syntax for SELECT would look like this:
SELECT [columns_to_display] FROM [table] WHERE [column] [LIKE] [match_sequence]
For example, using the following command I can search the "age" column and output the information in the "columns_to_display" for the people in their 20's. Note, the "*" selects all the available columns in the table.
mysql> SELECT * FROM my_table WHERE age LIKE "2%";
MySQL databases can also be queried remotely by other applications (for example MS Access). To allow access for other systems to query your database, you can use the GRANT command. To give yourself permission to access the database from multiple domains, alter the DOMAIN_I_WILL_BE_ACCESSING_FROM and run the command again.
mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER
-> ON my_database.* TO peter@DOMAIN_I_WILL_BE_ACCESSING_FROM
-> IDENTIFIED BY 'peters_password';
* License

