Ubuntu_16.04 [SOLVED]: I wrecked my server: best way to move forward?

Ubuntu_16.04 [SOLVED]: I wrecked my server: best way to move forward?

Home Forums Ubuntu 16.04 Ubuntu_16.04 [SOLVED]: I wrecked my server: best way to move forward?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #36809

    Anonymous

    QuestionQuestion

    As I said, my server is wrecked. Not entirely, just partially.

    I have a headless server running Ubuntu 16.04, and can reach it over SSH (and FTP via ssh port).
    On it, I have a modded minecraft server running in a screen (works fine), and a webserver in /var/www (development environment).
    Said webserver uses MySQL for a database.

    Now, yesterday I started installing ownCloud on it, which had stuff to do with MariaDB, I got as far as to go to the webpage to make an admin user, where it just asked me to log in. Tried some stuff, didn’t work. So I tried to remove it and am fairly (but not completely) certain that I got most of it.

    Then I tried the same thing with NextCloud, got to the webpage to make an admin user and got an empty page (HTML error 500/503), so a PHP error IIRC. Got fed up with this too after trying stuff, and once again tried to remove it.

    However, somewhere during the above process, I lost access to my MYSQL database. More specifically, when I log in using mysql command or www.domain.com/phpmyadmin webpage, I get this error:

    #2002 - No such file or directory<br />The server is not responding (or the local server's socket is not correctly configured).
    

    I remove’d, remove –purge’d, purge’d and whatnot a few variations of mysql*, mysql-client mysql-server mysql-common, done autoremoves, autocleans, apt-get -f installs, remove’d some more, reinstalled mysql-server and here is where I’m almost certain it’d be easier to backup the minecraft server and webserver, and reinstall ubuntu cleanly.

    Only problem there is that I need physical access, which I currently don’t have (I’m spending the christmas holiday at my parents’ place), however I live an hour away so it would be manageable to go for a few hours and back.

    Main Question:
    How would I go about getting my server completely operational again with a working MySQL, and preferrably NextCloud installed on it?

    Let me know if you need any more information.

    #36810

    Anonymous

    Accepted AnswerAnswer

    So after some discussion in chat…

    First problem was that /var/run/mysql did not exist. This explains the error message

    #2002 - No such file or directory
    The server is not responding (or the local server's socket is not correctly configured).
    

    as this socket is located in /var/run/mysql/.

    Next problem was that the user table was corrupt, so when starting with sudo -u mysql mysqld --skip-grant-tables to start without authentication, mysql did not want to update the user table:

    ERROR 1728 (HY000): Cannot load from mysql.user. The table is probably corrupted
    

    As user had backup of database content, the easiest option at this point was to simply remove all database files, with sudo rm -Rf /var/lib/mysql/, and reinstall mysql-server. This ensured that mysql recreated the user table upon installation.

    Source: https://askubuntu.com/questions/989864/i-wrecked-my-server-best-way-to-move-forward
    Author: vidarlo
    Creative Commons License
    This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.