Home / Software / How to Search a MySQL Database

How to Search a MySQL Database

MySQL command line interface
With web-based control panels and web software like phpMyAdmin, you have numerous options available for searching a MySQL Database. If the need should ever arise where those tools are not available, however, it is a good idea to know how to search a database from the command line.

To search MySQL from the command line, you need to log in to MySQL and perform a query.

Login as root:

mysql -u root -p
You should get a prompt like “mysql>”

To do a basic search, use the SELECT command. For example, to search for all records with the title of “Sales” that also have the number “44”, enter:

mysql> SELECT * FROM [table name] WHERE title = "Sales" AND number = '44';

You can perform similar queries on any tables in your database. For a more in-depth guide to queries, consult the MySQL documentation.

Photo Source: Wikimedia Commons

Check Also

Uk data center

Professional Data Centres In The UK

A professional data centre is a location in which various pieces of hardware are located …