Installing and using MySQL (on Fedora 15)

I had some trouble getting basic installation of MySQL to work, so here’s a ground-up tutorial.

  1. Install mysql and mysql-server from the repositories. On Fedora, that’s ‘sudo yum install mysql’ and the same with ‘mysql-server’.
  2. To run the MySQL server, you have to run the command ‘/etc/rc.d/init.d/mysqld start’. (You may need to run this as root by prefacing with ‘sudo’.)
  3. The problem I ran into was, it was trying to use the innodb database, which is not installed by default. So you need to edit the file ‘/etc/my.cnf’. Under the section [mysqld], add the lines:
    skip-innodb
    default-storage-engine=myisam
  4. Now run ¬†‘/etc/rc.d/init.d/mysqld start’ and it should say things are going ok. If not, you’ll have to check the error log file ‘/var/log/mysqld.log’ to see what went wrong.
  5. Now, from a terminal, run ‘mysql’. It should connect to the database you have running. ¬†This should open up in interactive MySQL interpreter where you can enter commands like “SHOW DATABASES;”.