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

Ubuntu's Software Updater wants to uninstall MariaDB; then, cannot re-access the database.

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 5.5.33a
    • None
    • None
    • None
    • Ubuntu Linux 13.04 and 13.10 64-bit Desktop.

    Description

      Looking for appropriate forum at MariaDB.org, I only find this. Please forward if necessary.

      Please help. Two surprises have combined to stop this experienced MS-Access developer in Windows, and experienced Ubuntu user currently learning MariaDB/LibreOffice Base:

      1. The Software Updater in Ubuntu Linux (both Raring and Saucy) prompts me to uninstall my MariaDB "because it's no longer used". I did so, assuming it would be reinstalled, and lived to regret it.

      2. Normal Ubuntu backups of /home did NOT include my mostly-completed, single-computer client database. (Yes, now I know it was in a /var/lib/mysql folder, but WHY not in /home? That very painful surprise is unmentioned in the books I've consulted. And although I have a copy of that folder (in /home/Documents), I still need help reaccessing that database.)

      Item 1, expanded:

      In Ubuntu Saucy Desktop (as before in Raring), the Software Updater wants to remove my single-computer MariaDB installation! Currently, I'm stopped without access to my database; please help me to get past this obstruction.

      Last week in Raring, when a Software Updater prompt said that, I made the mistake of allowing the removal because I assumed it was a first step in updating MariaDB. It took me three days to get the system back to working, and I still cannot retrieve my database.

      In hopes of solving this problem, I upgraded to Ubuntu 13.10 (Saucy Salamander). Then, I attempted to reinstall MariaDB, per the MariaDB web site (https://downloads.mariadb.org/mariadb/repositories/). Because that site did not include a .deb package, I used the required terminal-window installation. It resulted in "unmet dependencies".

      I next attempted the additional required fix at http://stackoverflow.com/questions/16214517/installing-mariadb-unmet-dependencies-mariadb-server-5-5, which instructs:
      For Ubuntu 13.10 (Saucy Salamander), use sudo apt-get install libmysqlclient18=5.5.33a+maria-1~saucy mysql-common=5.5.33a+maria-1~saucy mariadb-server mariadb-client

      I followed that advice - and now, again, Saucy's Software Updater wants to remove MariaDB! See the attached screenshot, and understand my frustration. This is what began this predicament, last week with Raring!

      Item 2, expanded:

      I have the database, but how to return in to /var/lib/mysql (which seems obvious, but) AND have MariaDB/LibreOffice Base access its tables?

      What in the world is going on? I am preparing this computer to move a client from MS-Access to LibreOffice Base/MariaDB; I think we all prefer that he not kill his major application!

      Thanks in advance for your help.

      Attachments

        Issue Links

          Activity

            elenst Elena Stepanova added a comment - - edited

            Hi,

            For the issue with unmet dependencies, automatic MariaDB removal and such, you are most likely experiencing the problem described here: http://tinyurl.com/c3jtdxj .
            You can find workarounds on the same page.

            For the question about datadir location, /var/lib/mysql is the default. This is said in the manual all right, e.g. here:
            http://dev.mysql.com/doc/refman/5.5/en/linux-installation-rpm.html#mysql-installation-layout-linuxrpm
            (it's for RPMs, but you can easily guess that the layout for deb packages should be close if not completely identical).
            If you want something other than default, add the datadir option with the desired location to your cnf file.

            For the LibreOffice access, I'm not quite sure what the problem is and why LibreOffice cannot access the data. Does it start MariaDB server of its own, or is it using one that is running in your system? If MariaDB server is started under mysql user as it's supposed to, and if the datadir in /var/lib/mysql has correct ownership, there should be no access problems. If it's not, then either the datadir ownership needs to be changed, or the startup process should.

            Regarding the forum to ask questions, you can use the IRC channel #maria on the freenode.

            elenst Elena Stepanova added a comment - - edited Hi, For the issue with unmet dependencies, automatic MariaDB removal and such, you are most likely experiencing the problem described here: http://tinyurl.com/c3jtdxj . You can find workarounds on the same page. For the question about datadir location, /var/lib/mysql is the default. This is said in the manual all right, e.g. here: http://dev.mysql.com/doc/refman/5.5/en/linux-installation-rpm.html#mysql-installation-layout-linuxrpm (it's for RPMs, but you can easily guess that the layout for deb packages should be close if not completely identical). If you want something other than default, add the datadir option with the desired location to your cnf file. For the LibreOffice access, I'm not quite sure what the problem is and why LibreOffice cannot access the data. Does it start MariaDB server of its own, or is it using one that is running in your system? If MariaDB server is started under mysql user as it's supposed to, and if the datadir in /var/lib/mysql has correct ownership, there should be no access problems. If it's not, then either the datadir ownership needs to be changed, or the startup process should. Regarding the forum to ask questions, you can use the IRC channel #maria on the freenode.
            JAMiller Jill Miller added a comment - - edited

            Thank you, Elena!

            I tried to reply via the web page, but could not figure out how so I'm replying directly to your e-mail.

            I now understand that the databases for mysql reside in /var/lib/mysql by default. I will check out how to change the my.cnf file to make them reside elsewhere. Can I just move the file there and have it work (presuming that the below problem gets resolved, of course)?

            Will a simple GUI backup program such as our favorite BackInTime (for a common user, not mysql's Terminal-window mysqldump command!) to back up my database and be able to successfully restore it? This is critical if I have to reinstall my client's system; see below.

            The problem with accessing the tables in the MariaDB database started after I copied the database files to the user's /Document folder (so that I could upgrade from Ubuntu Raring to Ubuntu Saucy). I have /home in a separate partition, so I can reinstall without losing my client's data. Because the database was not in /home, I copied (not moved) it to there using file copy, so that I could preserve it.

            When I copied the database back to /var/lib/mysql after the reinstall, the permissions were corrupted; they had the wrong user and group settings. After creating a second small database to determine what the correct setting should be, I was able to use the chown command to set them back. Now, when I use the 'show tables;' command in MySQLl/MariaDB to see the table names I can see the table names. The database and table names also appear in the LibreOffice Base tables list. However, I am unable to see the fields of the tables using the mysql command 'describe [table-name];' . It returns the error: "Table '[database-name].[table-name] doesn't exist". I also cannot see the contents of the tables from LibreOffice Base. Is there some file outside the database folder that keeps track of this information, and which I also need to restore? I did save the /var/lib/mysql/mysql folder, if that is helpful.

            IRC channel #maria on the freenode? Is there an alternative (forum, etc.) to chat sessions?

            Again, thanks from
            --Jill <[1]Jill@millermicro.com>

            JAMiller Jill Miller added a comment - - edited Thank you, Elena! I tried to reply via the web page, but could not figure out how so I'm replying directly to your e-mail. I now understand that the databases for mysql reside in /var/lib/mysql by default. I will check out how to change the my.cnf file to make them reside elsewhere. Can I just move the file there and have it work (presuming that the below problem gets resolved, of course)? Will a simple GUI backup program such as our favorite BackInTime (for a common user, not mysql's Terminal-window mysqldump command!) to back up my database and be able to successfully restore it? This is critical if I have to reinstall my client's system; see below. The problem with accessing the tables in the MariaDB database started after I copied the database files to the user's /Document folder (so that I could upgrade from Ubuntu Raring to Ubuntu Saucy). I have /home in a separate partition, so I can reinstall without losing my client's data. Because the database was not in /home, I copied (not moved) it to there using file copy, so that I could preserve it. When I copied the database back to /var/lib/mysql after the reinstall, the permissions were corrupted; they had the wrong user and group settings. After creating a second small database to determine what the correct setting should be, I was able to use the chown command to set them back. Now, when I use the 'show tables;' command in MySQLl/MariaDB to see the table names I can see the table names. The database and table names also appear in the LibreOffice Base tables list. However, I am unable to see the fields of the tables using the mysql command 'describe [table-name] ;' . It returns the error: "Table ' [database-name] . [table-name] doesn't exist". I also cannot see the contents of the tables from LibreOffice Base. Is there some file outside the database folder that keeps track of this information, and which I also need to restore? I did save the /var/lib/mysql/mysql folder, if that is helpful. IRC channel #maria on the freenode? Is there an alternative (forum, etc.) to chat sessions? Again, thanks from --Jill < [1] Jill@millermicro.com>

            Hi Jill,

            > I tried to reply via the web page, but could not figure out how so I'm replying directly to your e-mail.

            e-mail is fine – as long as you have JIRA on the list, the email will get attached to the report.
            To reply on the web page, you need to press the 'Comment' button either on the top or on the bottom of the page (you should be logged in to be able to do that).

            > Can I just move the file there and have it work (presuming that the below problem gets resolved, of course)?

            You should shut down the system properly, make sure that it reported that normal shutdown has been finished in the error log. Also, if you are using InnoDB, you might want to turn off innodb_fast_shutdown (look it up). Then, unless you have a very special setup which includes custom data storage for certain tables (which you most likely don't), you should be able to copy the files.

            > Will a simple GUI backup program such as our favorite BackInTime (for a common user, not mysql's Terminal-window mysqldump command!) to back up my database and be able to successfully restore it?

            Sorry, I'm not familiar with the tool and its requirements, you need to consult with the tool developers to find out if it has any special needs.

            > The problem with accessing the tables in the MariaDB database started after I copied the database files to the user's /Document folder (so that I could upgrade from Ubuntu Raring to Ubuntu Saucy). I have /home in a separate partition, so I can reinstall without losing my client's data. Because the database was not in /home, I copied (not moved) it to there using file copy, so that I could preserve it.

            > When I copied the database back to /var/lib/mysql after the reinstall, the permissions were corrupted; they had the wrong user and group settings. After creating a second small database to determine what the correct setting should be, I was able to use the chown command to set them back. Now, when I use the 'show tables;' command in MySQLl/MariaDB to see the table names I can see the table names. The database and table names also appear in the LibreOffice Base tables list. However, I am unable to see the fields of the tables using the mysql command 'describe [table-name];' . It returns the error: "Table '[database-name].[table-name] doesn't exist". I also cannot see the contents of the tables from LibreOffice Base. Is there some file outside the database folder that keeps track of this information, and which I also need to restore? I did save the /var/lib/mysql/mysql folder, if that is helpful.

            First, you must have copied not only /var/lib/mysql/mysql, but also all files and folders that live in /var/lib/mysql. Specifically make sure you copied all subfolders with their full contents, and all ib* and aria* files that reside in /var/lib/mysql.

            Second, please make sure that you restored not only the ownership (via chown) but the actual permissions (via chmod), they might have changed with the copying as well. Create a table using the same engine(s) in your second small database, check permissions of the newly created files and make sure yours with the same extensions have same access rights.

            Third, If permissions are all right but you are still experiencing the problem, the files and their location depends on storage engines that you use and your MariaDB configuration.
            Lets say you have a table `t1` in schema `db` and the table has storage engine MyISAM.
            There should be 3 files for this table in /var/lib/mysql/db folder – t1.frm, t1.MYI and t1.MYD
            If you are using InnoDB, there should be either one file t1.frm, or two files t1.frm and t1.ibd, depending on innodb_file_per_table server option (and in any case you must have ib* files in your /var/lib/mysql).
            And so on.
            Please check documentation for the specific engine(s) that you use to find out how and where they store the data.
            But in general, if you copied everything, did so after normal shutdown, and didn't mess up ownership and access rights, you should be all right.

            > IRC channel #maria on the freenode? Is there an alternative (forum, etc.) to chat sessions?

            Well, there are MariaDB mailing lists, but frankly I'm not sure you'll get there feedback you are looking for, your questions are quite generic and just require a bit of documentation and other search, it's not really what the mailing lists are for. On IRC you might have some luck. Your best chance is documentation and google, though. There are lots of forums out there in the internet which discuss basic and not-so-basic questions (mostly MySQL, but your questions so far don't have any MariaDB specifics, MySQL answers will work for you as well).

            elenst Elena Stepanova added a comment - Hi Jill, > I tried to reply via the web page, but could not figure out how so I'm replying directly to your e-mail. e-mail is fine – as long as you have JIRA on the list, the email will get attached to the report. To reply on the web page, you need to press the 'Comment' button either on the top or on the bottom of the page (you should be logged in to be able to do that). > Can I just move the file there and have it work (presuming that the below problem gets resolved, of course)? You should shut down the system properly, make sure that it reported that normal shutdown has been finished in the error log. Also, if you are using InnoDB, you might want to turn off innodb_fast_shutdown (look it up). Then, unless you have a very special setup which includes custom data storage for certain tables (which you most likely don't), you should be able to copy the files. > Will a simple GUI backup program such as our favorite BackInTime (for a common user, not mysql's Terminal-window mysqldump command!) to back up my database and be able to successfully restore it? Sorry, I'm not familiar with the tool and its requirements, you need to consult with the tool developers to find out if it has any special needs. > The problem with accessing the tables in the MariaDB database started after I copied the database files to the user's /Document folder (so that I could upgrade from Ubuntu Raring to Ubuntu Saucy). I have /home in a separate partition, so I can reinstall without losing my client's data. Because the database was not in /home, I copied (not moved) it to there using file copy, so that I could preserve it. > When I copied the database back to /var/lib/mysql after the reinstall, the permissions were corrupted; they had the wrong user and group settings. After creating a second small database to determine what the correct setting should be, I was able to use the chown command to set them back. Now, when I use the 'show tables;' command in MySQLl/MariaDB to see the table names I can see the table names. The database and table names also appear in the LibreOffice Base tables list. However, I am unable to see the fields of the tables using the mysql command 'describe [table-name] ;' . It returns the error: "Table ' [database-name] . [table-name] doesn't exist". I also cannot see the contents of the tables from LibreOffice Base. Is there some file outside the database folder that keeps track of this information, and which I also need to restore? I did save the /var/lib/mysql/mysql folder, if that is helpful. First, you must have copied not only /var/lib/mysql/mysql, but also all files and folders that live in /var/lib/mysql. Specifically make sure you copied all subfolders with their full contents, and all ib* and aria* files that reside in /var/lib/mysql. Second, please make sure that you restored not only the ownership (via chown) but the actual permissions (via chmod), they might have changed with the copying as well. Create a table using the same engine(s) in your second small database, check permissions of the newly created files and make sure yours with the same extensions have same access rights. Third, If permissions are all right but you are still experiencing the problem, the files and their location depends on storage engines that you use and your MariaDB configuration. Lets say you have a table `t1` in schema `db` and the table has storage engine MyISAM. There should be 3 files for this table in /var/lib/mysql/db folder – t1.frm, t1.MYI and t1.MYD If you are using InnoDB, there should be either one file t1.frm, or two files t1.frm and t1.ibd, depending on innodb_file_per_table server option (and in any case you must have ib* files in your /var/lib/mysql). And so on. Please check documentation for the specific engine(s) that you use to find out how and where they store the data. But in general, if you copied everything , did so after normal shutdown, and didn't mess up ownership and access rights, you should be all right. > IRC channel #maria on the freenode? Is there an alternative (forum, etc.) to chat sessions? Well, there are MariaDB mailing lists, but frankly I'm not sure you'll get there feedback you are looking for, your questions are quite generic and just require a bit of documentation and other search, it's not really what the mailing lists are for. On IRC you might have some luck. Your best chance is documentation and google, though. There are lots of forums out there in the internet which discuss basic and not-so-basic questions (mostly MySQL, but your questions so far don't have any MariaDB specifics, MySQL answers will work for you as well).
            JAMiller Jill Miller added a comment - - edited

            Elena,

            Thank you so much for your detailed help. I tried all those recovery actions  yesterday, and have not yet got my database running.

            I have provided more detailed comments in-line below.

            Bottom lines:
            1. I will have to recreate my tables.
            2. For the many less-experienced, single-computer MariaDB users who want and expect data to reside in /home, an installation option (or at least, a warning) would protect others from this potential loss of valuable data and work.
            3. For the same users, a simple example (script, etc.) for adapting a typical backup program should be provided.
            4. Your help has been invaluable in understanding what is happening and in mapping strategies for going forward.  Thank you!

            --Jill <[1]Jill@millermicro.com>

            JAMiller Jill Miller added a comment - - edited Elena, Thank you so much for your detailed help. I tried all those recovery actions  yesterday, and have not yet got my database running. I have provided more detailed comments in-line below. Bottom lines: 1. I will have to recreate my tables. 2. For the many less-experienced, single-computer MariaDB users who want and expect data to reside in /home, an installation option (or at least, a warning) would protect others from this potential loss of valuable data and work. 3. For the same users, a simple example (script, etc.) for adapting a typical backup program should be provided. 4. Your help has been invaluable in understanding what is happening and in mapping strategies for going forward.  Thank you! --Jill < [1] Jill@millermicro.com>

            Hi Jill,

            > I have provided more detailed comments in-line below.

            It seems that JIRA didn't receive any in-line part, so if there is something you want us to look at, please send it again.

            > 2. For the many less-experienced, single-computer MariaDB users who want and expect data to reside in /home, an installation option (or at least, a warning) would protect others from this potential loss of valuable data and work.

            The general perception is quite the opposite. The absolute majority of users, including less-experienced single-computer ones, prefer the automatic installation provided by common package facilities, such as apt-get, yum etc. MariaDB packages just work in compliance to the common rules.
            It's actually more experienced and advanced users (a small fraction of them) who choose flexibility over the convenience that packages provide. For those, we offer binary tarballs – it's packages which you can install and run anywhere, under any account, and have as many of them as you want. Maybe you need to look at this direction.

            > 3. For the same users, a simple example (script, etc.) for adapting a typical backup program should be provided.

            Typical backup facilities for MySQL/MariaDB are mysqldump and xtrabackup. There is a lot of information on their usage out there (in MySQL manual for mysqldump and in Percona documentation for xtrabackup). In MySQL manual you can also find information on how to move your data on the filesystem level if you need to.
            Unfortunately, there is no way we can document all third-party tools, it's rather a suggestion for the developers of the tool.

            elenst Elena Stepanova added a comment - Hi Jill, > I have provided more detailed comments in-line below. It seems that JIRA didn't receive any in-line part, so if there is something you want us to look at, please send it again. > 2. For the many less-experienced, single-computer MariaDB users who want and expect data to reside in /home, an installation option (or at least, a warning) would protect others from this potential loss of valuable data and work. The general perception is quite the opposite. The absolute majority of users, including less-experienced single-computer ones, prefer the automatic installation provided by common package facilities, such as apt-get, yum etc. MariaDB packages just work in compliance to the common rules. It's actually more experienced and advanced users (a small fraction of them) who choose flexibility over the convenience that packages provide. For those, we offer binary tarballs – it's packages which you can install and run anywhere, under any account, and have as many of them as you want. Maybe you need to look at this direction. > 3. For the same users, a simple example (script, etc.) for adapting a typical backup program should be provided. Typical backup facilities for MySQL/MariaDB are mysqldump and xtrabackup. There is a lot of information on their usage out there (in MySQL manual for mysqldump and in Percona documentation for xtrabackup). In MySQL manual you can also find information on how to move your data on the filesystem level if you need to. Unfortunately, there is no way we can document all third-party tools, it's rather a suggestion for the developers of the tool.

            I presume the problem has been resolved, feel free to comment if it's not.

            elenst Elena Stepanova added a comment - I presume the problem has been resolved, feel free to comment if it's not.

            People

              elenst Elena Stepanova
              JAMiller Jill Miller
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.