Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-5030

RPM installation not running mysql_install_db if datadir exists

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.5.33
    • Fix Version/s: 5.5.34
    • Component/s: None
    • Labels:
      None
    • Environment:
      CentOS 6 (haven't looked at the RPM specs for other platforms)

      Description

      The postinstall script of the 5.5.33 CentOS 6 bundle checks to see if the data directory exists, and if not, create it and run mysql_install_db:

        if [ ! -e $datadir ]; then
          # Create data directory
          mkdir -p $datadir/{mysql,test}
       
          # Initiate databases
          /usr/bin/mysql_install_db --rpm --user=mysql
        fi

      This prevents mysql_install_db from running if $datadir exists but is empty. An example of this situation is when $datadir is a separate partition, or perhaps someone wanted to do a fresh install and does "rm -rf /var/lib/mysql/*".

      I believe checking for $datadir/mysql would be a more accurate check, since that must exist or something really bad has happened.

      Thanks,
      -will

        Attachments

          Activity

            People

            • Assignee:
              serg Sergei Golubchik
              Reporter:
              wfong Will Fong
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: