Configuring MySQL on Slackware

Author: Steven Neiland
Published:

Warning: This blog entry was written two or more years ago. Therefore, it may contain broken links, out-dated or misleading content, or information that is just plain wrong. Please read on with caution.

While Slackware comes with MySQL preinstalled it is not also preconfigured. There are a few critical steps you need to do to configure MySQL otherwise whenever you start Slackware you will see an error for the mysql database. This will also fix the error message that the akonadi service generates when you start kde.

Step 1: Setup "my.cnf"

MySQL loads a config file called my.cnf at startup. This file needs to be created when you first setup MySQL. Fortunately there are several sample versions in the location . Just copy the desired version and make any desired changes to it (each one is self documented just open it in an editor for an explanation of its expected usage).

# cp /etc/my-[version].cnf /etc/my.cnf

Step 2: Install Required Databases

Mysql has a required database set which it needs for itself. These are used for user identification etc. To install them use mysql user as superuser and install the initial required databases with the following command.

# su mysql
# mysql_install_db

Step 3: Setup Required System Permissions

We now need to ensure that the mysql user has ownership of the mysql system. We also need to give the mysql init script permission to execute.

# chown -R mysql.mysql /var/lib/mysql
# chmod 755 /etc/rc.d/rc.mysqld
1 2 3

Reader Comments

  • Please keep comments on-topic.
  • Please do not post unrelated questions or large chunks of code.
  • Please do not engage in flaming/abusive behaviour.
  • Comments that contain advertisments or appear to be created for the purpose of link building, will not be published.

Archives Blog Listing