Jun 15, 2012

Vi and MySQL, Overkill

I got some good advice to get started with Python and Django to learn about web development, and to start with the tutorial. The benefit there is to learn a programming (scripting) language for coding and to learn a framework for building database-driven websites. I thought it would be proper to do this in a GNU/Linux environment, though it has been a few years since I had more than a casual use for it. Getting the necessary infrastructure in place where I could install Django took some review of the basics, like how to access MySQL and how to use vi.

I loaded a VirtualBox VM of openSUSE and got acquainted with command-line "yum install" and the graphical Synaptic Package Manager. I had MySQL installed, but I wasn't sure how to "switch it on." I came across the proper etiquette of "/etc/init.d mysqld start" or (in openSUSE) "rcmysql start" to get the daemon running, and of logging in via "mysql -u root -p" but I was at a loss for what to do at the "password:" prompt. It turns out the default root password is just "mysql" and you really ought to change it the first chance you get. Use "UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root'; FLUSH PRIVILEGES;". openSUSE also includes a utility to make MySQL a little more secure: "mysql_secure_installation".

All of this is good, but I realized at some point that I didn't need to get started with all of this complexity. I should be focusing on learning the core concepts of Python and Django before getting so distracted with the nuances of vi and MySQL. I can use the "nano" text editor for now, since I am already comfortable with it, and I can use SQLite, which comes almost effortlessly integrated with Django itself. I put so much effort into getting MySQL working that I just went ahead with using it, but some follow on advice I got is that SQLite is really effective in the early stages of developing a project, and accommodating MySQL comes later, if ever.

No comments:

Post a Comment