Can't start MariaDB or MySQL on CentOS7.4 - mysql

I tried to run mariaDB or MySQL on CentOS7.4. It was successful to start mariaDB and I had to change the configuration to allow remote access but during the process, I uninstalled mariadb/mysql and reinstalled it.
Since then I'm not able to start either mariaDB or MySQL. I have uninstalled and reinstalled both packages multiple times following instructions from multiple web sources using yum/rpm method and no fail or issues found during the installation. But no luck to start/enable mariaDB or MySQL yet. below is the message.
[root#localhost mariadb-10.2.13-rhel-7-x86_64-rpms]# sudo systemctl start mariadb
Failed to start mariadb.service: Unit not found.
I'm not sure where to look at first if want to fix this. anyone could guide me to the solution?

Related

How to fix a broken MySQL installation?

Installing a PHP application that requires MySQL or MariaDB, I first installed MariaDB via 'apt install' from the MariaDB repos, but there were behaviours with the installation of the application that seemed to be caused by some kind of incompatibility. Calls to the DB were timing out, and although I could see it was creating the DB, it was impossible to set the application up in its setup routine.
So I used apt remove to get rid of MariaDB. I saw the application had a *.deb installer for all requirements (wish I'd seen this sooner!) and, after removing PHP and Nginx, I attempted to install it the normal way. Unfortunately, the MySQL portion of the installation failed with:
Automatic maintenance of MySQL Server daemon disabled.
Packaging maintainer scripts detected a case that it does not know how to handle and cannot continue configuring MySQL. Automatic management of your MySQL Installation has been disabled to allow other packaging tasks to complete. For more details, see /etc/mysql/FROZEN
Unfortunately, /etc/mysql/FROZEN is a symlink to a non-existent file explaining downgrading. I can't run the uninstaller of the overall package or repair the installation with sudo --fix-broken install because the installer requires a MySQL password I can't provide it.
How can I fix my borked MySQL installation? If I could just get to a place to have MySQL run properly, understanding what left-overs perhaps from the MariaDB installation that I need to delete manually before trying to repair it, that would be helpful. FYI, the version of MariaDB was 10.3, and the version of MySQL the application package was installing was 5.7.
Any suggestions appreciated.

mysql_upgrade and MySQL service - Vicious Circle

I am upgrading MySQL server 5.067 to 5.5.60 on Windows 10.
I stopped the service, replaced bin a shared directory and started the service.
Service start failed with the message (in Event Viewer):
Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
For more information, see Help and Support Center at http://www.mysql.com.
OK, so I opened cmd as admin with the command:
mysql_upgrade --port 64202
With result:
Looking for 'mysql.exe' as: C:\Program Files (x86)\XXX\MySQLServer\bin\mysql.exe
Looking for 'mysqlcheck.exe' as: C:\Program Files (x86)\XXX\MySQLServer\bin\mysqlcheck.exe
Error: Failed while fetching Server version! Could be due to unauthorized access.
FATAL ERROR: Upgrade failed
The design of MySQL upgrade is connecting over TCP to MySQL to run the upgrade, but how it can possibly work if the service is not running? It is a vicious circle - MySQL service needs to be upgraded to be able to start and mysql_upgrade needs to connect to running service.
What is wrong?
Skipping major versions (5.1) is not supported, and may or may not work. The appropriate upgrade is one of:
Plan A: Upgrade to 5.1, then to 5.5. Run mysql_upgrade at each step.
Plan B: Dump the data from 5.0 with mysqldump. (Be sure to get routines, etc). Blow away (or bypass) 5.0 and install a fresh 5.5. Load the data back in. There may be syntax errors in the dump file, edit the file if needed.
Since you're upgrading from 5.0 to 5.5, there are configuration values which are deprecated, causing the engine to be unable to start.
Most likely culprit is skip-dbd, as explained on this site.
So: find your MySQL configuration file, comment out the skip-dbd option and restart the MySQL service. Then you can run mysql_upgrade with the appropriate options including authentication.

Maintaining multiple installations of MySQL

I have two installs of MySQL: one is a custom installation of MariaDB, and the other came prepackaged with XAMPP. Ideally I'd like to keep both and run either at separate times (I have no reason to run them together - thus port conflicting shouldn't be an issue).
When I run my MariaDB install, it runs fine. When I try running XAMPP install, it warns me "MySQL Service detected with wrong path," and doesn't get past "Attempting to start MySQL service..." when I try to run MySQL.
It also says "Found Path:" detecting the path to my MariaDB install, and "Expected Path:" indicating the location of the install prepackaged with XAMPP. What I don't understand is how it's even finding my MariaDB install.
I'm guessing it's something simple - any help is appreciated!
Details:
Windows 10
MariaDB 10.2.11
XAMPP v3.2.2
EDIT:
A similar question is answered here. However, my issue is not that the ports are conflicting, since my MariaDB install is not running. Notwithstanding, I've tried the solutions provided there, and still to no avail.

Mysql service wont start on windows 2008 server r1

About a month ago, after I changed a startup parameter on mysql administrator, my server got frozen. So I rebooted. Ever since my mysql service wont start on startup or when I try to start it manually. I can only start mysql in console mode (mysqld --console).
I have tried many things but none of them worked:
I have uninstalled and rebooted the server and then installed again;
I have deleted everything in program files folder related to mysql and installed again
I have deleted all the related files in programdata folder
I have treid to use 3307 port instead of 3306 but still not worked
Now when I install mysql again it can never manage to start the service during the setup procccess, so it never manages to end of installation. But I can still start the mysql server on command line with "mysqld --console"
I tried to look into the event lgo , the only error I see is plugin federated is disabled, I looked for solutitions about this error but none worked for me. I believe this might be something abput windows. Any help appreciated.
Uninstall, delete and all the cleanup you did above.
Additionaly manually delete MySQL Windows service.
This can be done by command line using sc stop MySQL then sc delete MySQL.
Before installing, a reboot shouldn't be necessary.
Recreating the Windows service manually, if the installer doesn't do it for you, can be done using "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld" --install (as the manual says).
If the MySQL installer has installed the service with on demand start-up type, you can edit to start automatically at boot using: sc config MySQL start= auto (the white space after the = sign is intentional and needed). Afterwards you can start the service using sc start MySQL.

Should I reinstall Mysql?

I'm getting kind of desperate here trying to get mysql to work on osx lion.
I've been through nearly every article on the web these past few days looking for a way to fix the problem with the error.
When I try to start the server is gives this error:
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
when I try to create a database with 'rake db:create' it gives the same error.
sometimes it says that or I get errors about "please install gem-blabhalbhabhlb". And that gem doesn't exist.
I was able to install mysql in terminal using the dmg version from mysql's site but after I deleted the installation files it just stopped working- as in when I run
rake cd:create
I get the mysql.sock error.
I'm going insane.. please help
For me I often need to force mysql to not use unix sockets, but regular php sockets.
To do this, connect to 127.0.0.1 instead of localhost. Works 90% of the time, all the time.
Major credit to John P. for helping me get this working last night
The first thing was to uninstall mysql using 'brew uninstall mysql'.
Then to install mysql from their development site. The community .dmg 64 bits version.
Then to find out where the path was pointing.
So in updating the paths he had to find where bin/mysql was and make sure bash_profile had it's path there.
PATH=$PATH:/usr/local/mysql/bin
The essential step after that was to 'source' the file so he had me run this command.
source ~/.bash_profile
From there mysql works flawlessly.