A while back I posted an article on creating MySQL databases from the command line (see here). I am a command line junkie, and usually prefer it to a GUI. I thought I would add to that last database post by sharing how I work with MySQL, designing databases and their structure in the initial phases of application development. Keep in mind, what I am going to go over in this post is strictly for quick and easy database structure design, possibly with test data, from the command line. This is not for mangling your database after you have real data in it, or else you will mangle your data! Read the rest of this entry »
Archive for the ‘MySQL’ Category
3
Creating MySQL database tables
20
Creating a new MySQL database with mysqladmin
Here is a quick tip for all of my command line brothers and sisters out there. If you need to create a new MySQL database, it’s super quick and easy to do it on the command line with the mysqladmin command. Yeah, there are some GUI’s out there, but just because you have a GUI doesn’t mean it’s easier or faster. Besides, if you know how to do it via the command line, you will have a better understanding of what that GUI tool is doing, especially when it messes up.
Back to the tip, if you want to create a database named ‘mydatabase’ you would type something like this:
mysqladmin create mydatabase
See? It’s just that easy! From here, it’s easy create tables too. You can type this right into the mysql prompt, or import from a text file. I’ll have more on that coming up soon. Stay tuned!



