0

I am running Ubuntu 16.04 LTS, with MySQL server for MediaWiki 1.30.0 along with Apache2 and PHP7.0. The installation was successful for everything, I managed to get it all running. Then I start installing extensions for MediaWiki. Everything is fine until I install the Virtual Editor extension. It requires that I have both Parsoid and RESTBase installed. So I install those along side Virtual Editor. Then I go to check my wiki and see this message (database name for the wiki is "bible"):

Sorry! This site is experiencing technical difficulties.

Try waiting a few minutes and reloading.

(Cannot access the database: Unknown database 'bible' (localhost))

Backtrace:

#0 /var/www/html/w/includes/libs/rdbms/loadbalancer/LoadBalancer.php(1028): Wikimedia\Rdbms\Database->reportConnectionError('Unknown databas...')

#1 /var/www/html/w/includes/libs/rdbms/loadbalancer/LoadBalancer.php(670): Wikimedia\Rdbms\LoadBalancer->reportConnectionError()

#2 /var/www/html/w/includes/GlobalFunctions.php(2858): Wikimedia\Rdbms\LoadBalancer->getConnection(0, Array, false)

#3 /var/www/html/w/includes/user/User.php(493): wfGetDB(-1)

#4 /var/www/html/w/includes/libs/objectcache/WANObjectCache.php(892): User->{closure}(false, 3600, Array, NULL)

#5 /var/www/html/w/includes/libs/objectcache/WANObjectCache.php(1012): WANObjectCache->{closure}(false, 3600, Array, NULL)

#6 /var/www/html/w/includes/libs/objectcache/WANObjectCache.php(897): WANObjectCache->doGetWithSetCallback('global:user:id:...', 3600, Object(Closure), Array, NULL)

#7 /var/www/html/w/includes/user/User.php(520): WANObjectCache->getWithSetCallback('global:user:id:...', 3600, Object(Closure), Array)

#8 /var/www/html/w/includes/user/User.php(441): User->loadFromCache()

#9 /var/www/html/w/includes/user/User.php(405): User->loadFromId(0)

#10 /var/www/html/w/includes/session/UserInfo.php(88): User->load()

#11 /var/www/html/w/includes/session/CookieSessionProvider.php(119): MediaWiki\Session\UserInfo::newFromId('1')

#12 /var/www/html/w/includes/session/SessionManager.php(487): MediaWiki\Session\CookieSessionProvider->provideSessionInfo(Object(WebRequest))

#13 /var/www/html/w/includes/session/SessionManager.php(190): MediaWiki\Session\SessionManager->getSessionInfoForRequest(Object(WebRequest))

#14 /var/www/html/w/includes/WebRequest.php(735): MediaWiki\Session\SessionManager->getSessionForRequest(Object(WebRequest))

#15 /var/www/html/w/includes/session/SessionManager.php(129): WebRequest->getSession()

#16 /var/www/html/w/includes/Setup.php(762): MediaWiki\Session\SessionManager::getGlobalSession()

#17 /var/www/html/w/includes/WebStart.php(114): require_once('/var/www/html/w...')

#18 /var/www/html/w/index.php(40): require('/var/www/html/w...')

#19 {main}

I checked the error logs in MySQL, and the error message said that the database was trying to be accessed without a password. I restarted my computer and restarted Apache, Parsoid, RESTBase, and MySQL. But I could not successfully restart MySQL. The error log by typing the command journalctl -xe and saw that it failed to start because it couldn't write to /var/lib/mysql/. I went to StackExchange to see if I could a solution, and one answer said to use the command mysql -u root -p. I did and typed in the password and it gave this error:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

I also check the status of it by typing sudo mysqladmin status which said:

mysqladmin: connect to server at 'localhost' failed error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)' Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!

I wanted to verify that it existed, but upon browsing to the location of the socket, I found it was not there. I saw an answer about a missing MySQL socket which said to use the touch command to create the socket and another file. I did it and still had the same issues. I went back to the directory and found the two files to be missing. So I created them again with the touch command and watched the folder to see what happens. After about half a minute, the folder seems to be deleted and recreated. I get kicked out of the folder into it's parent directory and when I go back in the files are gone.

Does anybody know why this is happening, or at least how I can fix this and get MySQL back up and running?

3
  • My immediate thought is that /var/lib/mysql isn't writable or is being protected by something, or there is an underlying hardware problem. Can you try touching a plain file, and also give use some idea of your hardware setup. Commented Feb 10, 2018 at 8:29
  • @SimonGreenwood I am thinking that it has something to do with the folder being protected. I don't know what is protecting it nor how to find out. There also seems to be something controlling the folder containing the sockets but I don't know how to find out. When I get a chance to experiment on my computer, I will let you know what happens. I have never used touch before, so that is new for me. Commented Feb 10, 2018 at 20:51
  • Apparmor may be running although MySQL usually has a profile. You can try running apparmor_status. Commented Feb 10, 2018 at 21:22

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.