Archive

Archive for August, 2009

MySQL root access with sudo

August 28th, 2009 bfluri No comments

Normally, the system’s root user does not automatically have root access to the MySQL (mysql in short) databases on the system. However, sometimes we’d like to have root access on our mysql databases via sudo. This is possible when performing the following steps as root:

  1. $ touch /root/.my.cnf
  2. $ chmod 600 /root/.my.cnf
  3. Put the following text into /root/.my.cnf:
    [client]
    password        = <mysql root password>
    port            = 3306
    host            = localhost
    socket          = path/to/your/mysql.sock

When having a .my.cnf file in the home-directory, executing mysql starts the mysql-client under the currently logged-in user and by using the password provided in the ~/.my.cnf file. This also means, that

$ sudo -H mysql

starts the mysql-client under mysql-”root.” The option “-H” is necessary because sudo has to change the home-directory to the system’s root user, i.e., /root/. Otherwise, mysql uses the ~/.my.cnf file of the user executing sudo.

Categories: Server Administration Tags: , , ,

Hello blogging world!

August 19th, 2009 bfluri No comments

I also started bloging. Why? Well, mainly because I’d like to share my experience with other people. I often find myself searching for the same configuration, installation procedure, or implementation hint again and again. Sometimes it is even hard to find the information again, because you have to glue it together from different sources. This blog should help me, and hopefully others too, to store information I collected to fulfill a certain task on the computer (developing, installing, configuring, etc.). You can never find enough information sources describing a similar solution to the same problem.

I also started blogging because I’d like to share interesting stuff that I read, and, last but not least, nowadays it is courteous to blog ;)

Categories: Uncategorized Tags: