Solved Cannot start mysql

OP
S

SAJM

Active Member

Reaction score: 12
Messages: 138

find /var/db/mysql/ \! -user mysql

try that as root
should find nothing

Code:
$ su
Password:
root@ellamay:/usr/home/steve # find /var/db/mysql/\! -user mysql
find: /var/db/mysql/!: No such file or directory
root@ellamay:/usr/home/steve # find /var/db/mysql/ \! -user mysql
root@ellamay:/usr/home/steve #
 

covacat

Well-Known Member

Reaction score: 171
Messages: 366

$ su Password: root@ellamay:/usr/home/steve # find /var/db/mysql/\! -user mysql find: /var/db/mysql/!: No such file or directory root@ellamay:/usr/home/steve # find /var/db/mysql/ \! -user mysql root@ellamay:/usr/home/steve #
leave a space before !
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 11,615
Messages: 37,958

No amount of reinstalling databases/mysql57-server is going to "fix" the issues that are present in the datafiles.

Simple question, is there any data in /var/db/mysql/? If there is data do you need to preserve it or can it be destroyed?

If you just want to start with a "fresh" clean database, then stop mysql (it probably wasn't running anyway); service mysql-server stop. Then remove everything, note that this will REMOVE any existing databases, data and whatnot, so be sure this is what you want to do; rm -rf /var/db/mysql/*. Check the permissions of /var/db/mysql directory, it should be owned by mysql:mysql. Start the service for the first time: service mysql-server start. Does that work?
 

Grzegorz Wiktorowski

Member

Reaction score: 11
Messages: 23

I suggest to rename /var/db/mysql folder for preserving data. I'm not sure but I saw something similar when MySQL upgraded from 5.6 to 5.7 (as Zabbix 4 dependency). I had to reinstall 5.6, unload the database, install 5.7 and load from the dump file. Maybe it's wrong assumption.
 
OP
S

SAJM

Active Member

Reaction score: 12
Messages: 138

Code:
root@ellamay:/usr/home/steve # rm -rf /var/db/mysql/.*
rm: "." and ".." may not be removed
root@ellamay:/usr/home/steve #

I'm root so I assume I should be able to do this.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 11,615
Messages: 37,958

I'm root so I assume I should be able to do this.
No, you may not. You can't remove the special directories . and ... And it's rm -rf /var/db/mysql/*, not rm -rf /var/db/mysql/.*
 
OP
S

SAJM

Active Member

Reaction score: 12
Messages: 138

Here we go.


Code:
root@ellamay:/usr/home/steve # rm -rf /var/db/mysql/.*
rm: "." and ".." may not be removed
root@ellamay:/usr/home/steve # rm -rf /var/db/mysql/*.
rm: No match.
root@ellamay:/usr/home/steve # cd /var/db/mysql/
root@ellamay:/var/db/mysql # ls
-slow.log               client-cert.pem         ib_logfile1             mysql-bin.000003        performance_schema      server-key.pem
auto.cnf                client-key.pem          ibdata1                 mysql-bin.000004        private_key.pem         sys
ca-key.pem              ib_buffer_pool          mysql-bin.000001        mysql-bin.index         public_key.pem
ca.pem                  ib_logfile0             mysql-bin.000002        mysql2                  server-cert.pem
root@ellamay:/var/db/mysql #
 

anlashok

Member

Reaction score: 41
Messages: 67

Is that *dot or * comma?

it’s neither. The command ends with /* and nothing else, so
Code:
rm -rf /var/db/mysql/*
meaning delete all files that match the * wildcard, which is everything in the folder list you posted. When you typed it with /*. It would only delete files that ended with a .
As mentioned, only do this if you are happy to delete everything in the database
 
OP
S

SAJM

Active Member

Reaction score: 12
Messages: 138

I have regained access to mysql. Thank you so much for the help and everyones time.

It has raised a few questions:

Why was I suddenly locked out of mysql?
When I deleted mysql server Libraoffice was also removed. Why would this be?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 11,615
Messages: 37,958

Why was I suddenly locked out of mysql?
Can't tell after the fact. Could be anything, including entering the wrong password.

When I deleted mysql server Libraoffice was also removed. Why would this be?
Because LibreOffice has a dependency on it (don't know why it needs that though).
 
OP
S

SAJM

Active Member

Reaction score: 12
Messages: 138

Because LibreOffice has a dependency on it (don't know why it needs that though).

Interesting thread here on the subject

 

Alain De Vos

Daemon

Reaction score: 548
Messages: 1,893

there is good alternative for libreoffice and openoffice
Code:
pkg install editors/calligra
 
OP
S

SAJM

Active Member

Reaction score: 12
Messages: 138

there is good alternative for libreoffice and openoffice
Code:
pkg install editors/calligra

And It's KDE, that's nice

But Libreoffice does have a good CAD add on that I use a great deal though.
 
Top