i received an zabbix server start error and shared solition - zabbix

I recieved an error. It is in /var/log/zabbix/zabbix_server.log
[Z3001] connection to database 'zabbix' failed: [2059] Authentication plugin 'caching_sha2_password' cannot be loaded: /usr/lib64/mysql/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory
3020:20191216:145338.629 Cannot connect to the database. Exiting...
And i can't start zabbix-server
service zabbix-server start
or
systemctl start zabbix-server
i want to show status with systemctl status zabbix-server command
The output was as pictured
this solition is in answer.

I've solved this problem
After that the problem is solved.

Related

MYSQL and MYSQLD not start MySQL 5.7 enterprise version on CentOS7

I just install MySQL 5.7 enterprise version 5.7.1 commercial Client and then Install 5.7.1 commercial server.
I didn't do any thing just restart CentOS 7 VM
when I try to start the service of mysql i got error
1st i Try to start service using
service mysql start
Redirecting to /bin/systemctl start mysql.service
Failed to issue method call: Unit mysql.service failed to load: No such file or directory.
then i try the following command
service mysqld start
Starting mysqld (via systemctl): Job for mysqld.service failed. See 'systemctl status mysqld.service' and 'journalctl -xn' for details. [FAILED].
I unInstall the MySQL and delete the folder where log and data files created and then reinstall MySQL then restart CentOS again same Issue.
Regards,
Saad

Problem with virsh / cannot connect to qemu

I am trying to setup KVM, but when running $ sudo virsh net-define br10.xml I get this:
error: failed to connect to the hypervisor
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory
And when jumping into virt-manager GUI a get this dialog Unable to connect to libvirt qemu:///system.
I checked if I am in both kvm and libvirt groups and that seems okay.
I also checked if the libvrt-sock file is created when running $ sudo systemctl start libvirtd.service but there is nothing.
So it showed up that privilges for my files wasn't set correctly. Now everything works

can't connect to any database after upgrading open-ssh

I upgraded open ssh with this command: sudo apt-get upgrade openssh-server
I rebooted the server and after that, I can't connect to any database (Wordpress database, you'll database, phpmyadmin database)
for Wordpress I get: Error establishing a database connection
for yourls I get: Incorrect DB config, or could not connect to DB
for phpmyadmin I get: mysqli_real_connect(): (HY000/2002): No such file or directory
WHat's the solution please!
I think that it's a mysql problem because it doesn't not start and when I check mysql.service I find that's failed
WHat's the solution please!
This is logs:
This is the error log /var/log/mysql/error.log
error.log page 2
mysql status
systemctl status mysql.service
journalctl -xe page 1
journalctl -xe page 2
journalctl -xe page 3
You can check MYSQL status by running following command
sudo /etc/init.d/mysql status
Or restart and try once
sudo /etc/init.d/mysql restart
If you still can not connect database you can change DB_HOST localhost to 127.0.0.1.
Finally, the solution was to go to: etc/mysql/mysql.conf.d/mysqld.cnf
I found mysqld.cnf permission set to 644
I change it to 777 and the MySQL works again.
I don't know why running the upgrade with this command
sudo apt-get upgrade openssh-server
changed many permissions to files and directories.
I think that 777 is too open, can I make a less permission without stoping MySQL? what permission do you advise me to both mysqld.cnf and my.cnf in those directories?
etc/mysql/mysql.conf.d/mysqld.cnf
and
etc/mysql/my.cnf
welcome,
Try the permission 640 (rw-r-----). That's the minimal permission required.

Can't connect to '/var/run/mysqld/mysqld.sock'

This is my first post here, so I hope I do everything right and don't forget any important info. I'm glad for any hints, because I'm running out of ideas (if I ever had any ;)).
I am (or was) running owncloud on Raspbian Jessie (so I guess basically Debian). Suddenly owncloud stopped working. The nginx error points towards php5-fpm, further searches gave this error:
exception 'Doctrine\DBAL\DBALException' with message 'Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)' in /var/www/owncloud/lib/private/db/connection.php:54
So it looks like a mysql error, and /var/run/mysqld/ is actually empty.
Following these posts 1 and
2, I tried
sudo find / -type s
resulting in this output:
/run/php5-fpm.sock
/run/fail2ban/fail2ban.sock
/run/thd.socket
/run/dhcpcd.unpriv.sock
/run/dhcpcd.sock
/run/dbus/system_bus_socket
/run/avahi-daemon/socket
/run/udev/control
/run/systemd/journal/syslog
/run/systemd/journal/socket
/run/systemd/journal/stdout
/run/systemd/journal/dev-log
/run/systemd/shutdownd
/run/systemd/private
/run/systemd/notify
find: `/proc/30933/task/30933/fd/5': No such file or directory
find: `/proc/30933/task/30933/fdinfo/5': No such file or directory
find: `/proc/30933/fd/5': No such file or directory
find: `/proc/30933/fdinfo/5': No such file or directory
In the processes with top on the other hand, mysqld and mysqld_safe show up.
mysql-client, mysql-server and php5-mysql are installed and updated to the latest versions.
I also had a look at
/etc/mysql/my.cnf
/etc/mysql/debian.cnf
both show /var/run/mysqld/mysqld.sock as socket...
/var/lib/mysql/my.cnf
mentioned here does not exist.
Additionally, it seems that I can't connect to mysql through
mysql -u user -p
at least it results in the Error 2002 as well.
Finally, I tried stopping and starting the mysql service. This resulted in the following output of
systemctl status mysql.service
mysql.service - LSB: Start and stop the mysql database server daemon
Loaded: loaded (/etc/init.d/mysql)
Active: failed (Result: exit-code) since So 2016-04-10 11:54:23 CEST; 23s ago
Process: 9777 ExecStop=/etc/init.d/mysql stop (code=exited, status=0/SUCCESS)
Process: 12878 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE)
So I'm kind of lost what is going on, the problem occurs since some updates a few days ago. While writing this post, I went through all the steps again, just to be safe. At one point, I had a short glimpse at my owncloud instance in the browser, but then it was gone again. So I appreciate any help/hints!!!
Thank you very much!!!
I faced the issue: Can't connect to '/var/run/mysqld/mysqld.sock'. The problem was that mysql service was not started after installation. Once I run the following command, then it worked properly:
systemctl start mysql.service
mysql -u root -p
1.Activate log in .my.cnf
log = /var/log/mysql/mysql.log
Error logging goes to syslog. This is a Debian improvement :)
Here you can see queries with especially long duration
log_slow_queries = /var/log/mysql/mysql-slow.log
long_query_time = 2
log-queries-not-using-indexes
$ ls -l /var/run/ | grep mysqld
$ ps -ef |grep mysql
tail -f /var/log/mysql/mysql.log
restart mysql
(option) delete socket & restart mysql

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

I have installed Centos7 update, removed MariaDB and done a fresh install of MySQL - additionally I have removed it and reinstalled it but everytime I connect to mysql -u root -p I get the titled error. Additionally I have looked at other tickets associated with this but still not making progress. If I run service mysqld restart it says "Redirecting to /bin/systemctl restart mysqld.service" and then just hangs. Really not a linux expert so not sure what is causing this?
I had the same problem and found out a few things after digging around. MariaDB is a drop-in replacement for mysql. On the new system, mysql is the MariaDB client (although I'm not clear on what that means). I checked to see if the service was running:
service mysqld status
which indicated:
Redirecting to /bin/systemctl status mysqld.service
mysqld.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)
In other words, the mysqld service is not running.
Starting the service worked for me:
`systemctl start mariadb.service`
Now all the mysql commands work as expected.
To tie the last knot, enable the service at boot:
`systemctl enable mariadb.service`
Check the 'socket=' entry in your /etc/my.cnf within the [mysqld] section:
[mysqld1]
socket = /tmp/mysql.sock1
An alternate method is to provide the '-hhost' & '-Pport' parameters to the 'mysqladmin' or 'mysql' commands, to avoid using the socket.
mysql -u user -hservername -P3006 -p -Dschema
mysqladmin -u user -p -hhostname -Pport
Removing the dir fixed it - deleted the dir (with rm -rf "dir name") and then unintalled mysql "yum remove mysql mysql-server" then reinstalled "yum install mysql-server" and ran "service mysqld start"
If you have this problem with the start mysql service hanging - check the logs /var/log/mysqld.log as suggested by Jeremiah.
If you look into the MariaDB log file, you may see that the issue is related to creating pid file. To solve it: create the PID directory then change its owner to mysql:mysql