Archive for the ‘MySQL’ Category.

MySQL World Cities database installation

MaxMind offers a free cities database, the database contains more than 2.7 mil. locations, you can download it at MaxMind’s website. Once you have downloaded the compressed database, extract the file worldcitiespop.txt and invoke the MySQL client (preferably from the same directory where the worldcitiespop.txt file resides). Create the world database and the cities table [...]

MySQL statement terminators

There is the semicolon “;” that every one knows, and “\g” which is just the same: mysql > SELECT * FROM wp_links; mysql > SELECT * FROM wp_links\g Those are exactly the same, and will produce the same result, here is an example: mysql> select * from wp_links \g +———+———————–+————–+————+————-+—————+——————+————–+————+————-+———————+———-+————+———————–+ | link_id | link_url …

MySQL script files how-to

What is a MySQL script file?.. Why use it? A MySQL script file (aka MySQL batch file) is a regular text file containing MySQL statements separeted by terminantors, statements in a MySQL script file can be run from the MySQL client, this is very useful, many PHP script available online come with MySQL script files [...]