MySQl 5.7 installation failed on Kubuntu 16.04 [closed] - mysql

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
Configuring mysql-server-5.7 (5.7.11-0ubuntu6) …
insserv: warning: current start runlevel(s) (empty) of script `mysql' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `mysql' overrides LSB defaults (0 1 6).
mysql_upgrade: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) while connecting to the MySQL server
Upgrade process encountered error and will not continue.
mysql_upgrade failed with exit status 11
dpkg: error with
mysql-server-5.7 (--configure):
apt-get remove return the same result.
This error come in with upgrade from 15.10 to 16.04

It was exactly same for me: runlevel warnings and mysql_upgrade error.
I guess it was because I disabled mysql service, enabling it fixes the problem:
sudo systemctl enable mysql

I've just encountered this problem, there's a bug report that is quite similar here: https://bugs.launchpad.net/ubuntu/+source/mysql-5.7/+bug/1584287
In my case I had the mysql.service set to disabled and the mysql_upgrade script seemed incapable of starting the server in this case. I enabled the service (didn't need to start it) and re-ran the upgrade. After that worked I stopped the service and disabled it again.
I'm not sure what else might cause this, but if someone encounters this with the service disabled, just enable it for the upgrade.

Manualy remove all file of MySQL server

Seems mysql-server is now replaced with mariadb
Installing maridb-server fixed the issue.
sudo apt-get install mariadb-server
Note:- You won't get your databases. Reset mysql password using command mysql_secure_installation

In my case I could solve the problem by changing apparmor (on kubuntu 16.04 using plasma).
I took a look at journalctl -xe as suggested by the installation error message:
[....] Starting mysql (via systemctl): mysql.serviceJob for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.
In there I found apparmor DENIED messages:
AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/home/system/var/log/mysql/error.log" pid=32610 comm="mysqld" request
In deed, the base directory /home/system/... exists, but access is not allowed by /etc/apparmor.d/usr.sbin.mysqld.
So adding the following lines to /etc/apparmor.d/local/usr.sbin.mysqld solved my problem:
# For more details, please see /etc/apparmor.d/local/README.
# Allow log file access
/home/system/var/log/mysql.err rw,
/home/system/var/log/mysql.log rw,
/home/system/var/log/mysql/ r,
/home/system/var/log/mysql/** rw,
Don't forget to restart apparmor, and restart mysql installation (e.g. apt-get install --reinstall mysql-common mysql-server or whatever is your way to install it.)
I don't know at all why (and since when) the directory /home/system exists and why mysql points in there. But some day a hopefully figure out ... ;)

Below worked for me, found solution - here
sudo update-alternatives --remove my.cnf /etc/mysql/my.cnf.migrated
sudo service mysql start

I found the solution here
Remove all of mysql's files:
rm -r /var/lib/mysql*
Install mysql self database:
mysql_install_db -u mysql
(might not work for newer systems, but don't worry)
Enable the service for systemd: systemctl unmask mysql.service
Then start the mysql service service mysql start

Related

mysql.sock does not exist error in fresh install of MySQL on Arch Linux

I'm trying to use MySQL on Arch Linux. it is already installed but this error comes up when I try to connect:
connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2 "No such file or directory")'
I've looked for /etc/my.cfg but the file does not exist.
Something must have gone wrong during the installation.
How can I "purge" MariaDB and reinstall it?
If you're using archlinux it is a vital idea to understand the package manager (pacman). For the question about /etc/my.cfg you can run
pacman -Ql mariadb
there you will see that the file is actually called:
/etc/mysql/my.cnf
Arch linux will not configure the package for you, that is part of the arch philosophy. It will provide example configurations, and even provide you with a systemd unit file
usr/lib/systemd/system/mysqld.service
but it is your responsibility to ensure that the configuration is correct and actually start the daemon.
systemctl enable mysqld # add the unit file to the boot sequence
systemctl start mysqld # runs ExecStart= in the unit file
systemctl stop mysqld # kills the daemon
systemctl disable mysqld # remove unit from boot sequence
reinstall
Since the word reinstall is in the title of the question and someone might find this question thanks to that: To reinstall mariadb you simply do
pacman -S mariadb
pacman will reinstall a package that is already installed, there is no need to remove the package (for completeness, package removal happens with pacman -R)
as of 7-28-17 I had to do this on a new install. Newbie here might save someone some time. It was a real pain.
OK HERE IS THE DEAL!!!!!
INSTALL APACHE _ NO PROB
INSTALL MYSQL _PROBLEM
pacman -S mysql then before starting service
MUST UNCOMMENT INNODB IN:
nano /etc/mysql/my.cnf
then must initialize datadirectory before starting service:
mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
You need to initialize the MariaDB data directory prior to starting
the service. This can be done with mysql_install_db command, e.g.:
mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
Optional dependencies for mariadb
galera: for MariaDB cluster with Galera WSREP
perl-dbd-mysql: for mysqlhotcopy, mysql_convert_table_format and
mysql_setpermission
CNF file is /etc/mysql/my.cnf in Arch Linux.
One simple way I can reproduce your issue is when MariaDB is shut down. Sorry if it sounds dumb but as you did not mention it: is MariaDB started? sudo systemctl start mysqld.service
You should have a look at MariaDB logs to get some clue: journalctl _SYSTEMD_UNIT=mysqld.service (maybe paste some part if you still don't get what is going on).
This happens the first time you install MySQL and MariaDB. As grochmal pointed out, you have to set up configurations before first use. But, the user teckk sent these three links in the archlinux newbie corner:
https://wiki.archlinux.org/index.php/MariaDB
https://wiki.archlinux.org/index.php/MariaDB#Reset_the_root_password
https://bbs.archlinux.org/viewtopic.php?id=51981
In short, you have to run the command below before starting the service:
sudo mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
Optionally (recommended) you should improve the initial security by calling:
sudo mysql_secure_installation
Now you can start the service:
sudo systemctl start mariadb
Optionally, you could install and use a graphical front-end tool.
Carry on with setting up the configurations as described in the archwiki post on MariaDB Configuration.

mysqld.service failed because a timeout was exceeded

With this command:
sudo systemctl restart mysqld
I face with this error:
Job for mysqld.service failed because a timeout was exceeded. See "systemctl status mysqld.service" and "journalctl -xe" for details.
How can I solve it?
Most probably you have huge database that requires a lot of time to start.
If that's the case then you can change the service start timeout to something that will work for you. To do that add this line to the service file:
TimeoutSec=1200
or
TimeoutStartSec=1200
If you are using MariaDB then the file is located at this path:
/usr/share/mysql/systemd/mariadb.service
If you are using MySQL then probably the path is:
/usr/share/mysql/systemd/mysqld.service
Reinstalling MySQL might help:
Uninstall the current MySQL
Delete /var/lib/mysql and /etc/mycnf or /etc/mycng.rpmsave
Reboot the machine
Reinstall MySQL
This maybe related to selinux being set to enforcing. Have a look at /etc/selinux/config (on CentOS, location may vary on other distributions). If SELINUX=enforcing, try setting SELINUX=permissive and
Reboot the machine
Start MySQL if not already (sudo systemctl start mysqld)
In case SELINUX=enforcing is required, have a look at https://www.techrepublic.com/blog/linux-and-open-source/practical-selinux-for-the-beginner-contexts-and-labels/ or other similar posts.
Hope this helps.

MySql ERROR! The server quit without updating PID file [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I inherited a computer that previously had MySql server installed and then uninstalled (apparently, it ran fine before the uninstall). I am in Database class, so I tried to install it again and now I get the error:
Starting MySQL
. ERROR! The server quit without updating PID file (/usr/local/mysql/data/Computer.local.pid).
I looked online and saw this error happened to others, but either a)I couldn't figure out how to do the fix or b)the fix didnt work for me.
I tried(from http://coolestguidesontheplanet.com/mysql-error-server-quit-without-updating-pid-file/):
Computer:/ computer$ /usr/local/mysql/support-files/mysql.server restart
And I get this error:
ERROR! MySQL server PID file could not be found!
Starting MySQL
. ERROR! The server quit without updating PID file (/usr/local/mysql/data/Computer.local.pid).
I am not sure what they are telling me to do here:
Remove /etc/my.cnf or just back it up for now and restart:
sudo mv /etc/my.cnf /etc/my.cnf.bak
because I get this error when I type:
Computer:/ computer$ cd /usr/my.cnf
-bash: cd: /usr/my.cnf: No such file or directory
I also see from: mysql ERROR! The server quit without updating PID file?
That there are error logs and the my.cnf file, but I am not sure to access them.
The MySql I downloaded: mysql-5.7.10-osx10.9-x86_64.dmg
I am on a mac version 10.7.5
Thanks!
Mostly this is a permission issue
Step1: Check the error file first.
tail -f /usr/local/mysql/data/*.err
Step2: Do a complete shut down or kill the process. Confirm that no mysql process is running
mysqladmin -uroot shutdown
sudo killall mysqld
ps -ef | grep mysql
Step3: Give permisiions
sudo chown -RL root:mysql /usr/local/mysql
sudo chown -RL mysql:mysql /usr/local/mysql/data
chmod -R 755 /usr/local/mysql/data
Step4: Start mysql
sudo mysql.server start

sudo systemctl start returns "Failed to wait for response: Success"

I'm following this tutorial to install nginx and mysql on a new server.
I'm running into problems when I run either of sudo systemctl start mysqld && mysql_secure_installation or sudo systemctl start nginx.
With either of these I get the response "Failed to wait for response: Success". I'm not sure what this means, but I assume it means something went wrong. Do you have any idea what this message means and what I can do about it?
I faced a similar issue with systemctl where start and stop command would always fail, but the services were getting started and stopped correctly.
You can check if the services are effectively getting started and stopped correctly with systemctl status service-name.
I have also seen the mentioned error message Failed to wait for response: Success in many other post out there, so it seems to be a problem with systemctl.
After upgrading package systemd to version 215-4 the problem went away.
In my particular case the situation was worse, because systemctl failures were blocking package installation.
Namely, package systemd depends on package udev, but package udev could not be configured because service start/stop operations would fail.
The solution was to force the installation of package systemd ignoring udev dependency, and fix dependencies after.
# dpkg --ignore-depends=udev --install /var/cache/apt/archives/systemd_215-4_amd64.deb
# apt-get install -f

fresh installed mysql and mysql-server but failed to start server

I am new to Linux and tried to install mysql in my local box
I googled a lot and follow the instruction but none of them works
some people recommand this" but it did not work for me and system give me warning about this is not a official version.
Basically what I did was:
yum install mysql mysql-version
succeed without error, version is 5.5.28
systemctl start mysqld.service
here it threw out error:
Job failed. See system logs and 'systemctl status' for details.
I am using Fedora 16 (3.1.0-7.fc16.i686)
Thank you in advance
Could you try running
yum groupinstall "MySQL Database"
then run
service mysqld start
and see the outcome. Assuming you are running as root or with root permissions.
Got the EXACT same problem. It seems there is an issue regarding the permissions of the /var/lib/mysql directory.
This nailed it for me:
chown -R mysql.mysql /var/lib/mysql
Source: http://www.vivaolinux.com.br/dica/Como-solucionar-ERROR-2002-Cant-connect-to-local-MySQL-server