I got a Problem with my Zabbix Server.
He was running the days ago, and then the dashboard shows up:
Zabbix Server is running --> Value NO
And: Zabbix server is not running the information displayed may not be current
I didnt change some configs in the past.
Then I looked in the Zabbix Server Log File in: /var/log/zabbix/zabbix_server.log
And the Error shows up:
15909:20201011:000020.063 [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'#'localhost' (using password: NO)
15909:20201011:000020.063 database is down: reconnecting in 10 seconds
I already checked the Zabbix Config File in: /etc/zabbix/zabbix_server.conf
DBName, DBUser, DBPassword are all correct
Can someone tell me why the Error shows "(using password: NO)"?
Usually it means that no password was entered for the login?
PROBLEM SOLVED
Solution: I was adding an HP Switch IN THE PAST with the HP Enterprise Switch Template.
When the SNMP Discover was finished, there wore more than 2000 Items.
So it was a Stackoverflow :D
Have a nice day!
Please ensure you have no spaces before or after the PASSWORD line, and that it matches exactly with the following 2 files:
nano /etc/zabbix/zabbix_server.conf
### Option: DBPassword
# Database password.
# Comment this line if no password is used.
#
# Mandatory: no
# Default:
DBPassword=Ex4mmpleT3st!
#
#
AND:
nano /etc/zabbix/web/zabbix.conf.php
$DB['PASSWORD'] = 'Ex4mmpleT3st!';
Verify by checking the RESTARTING and checking the log:
service zabbix-server restart
cat /var/log/zabbix/zabbix_server.log
Related
I am following mysql on Cygwin.
# To begin MySQL setup run the following:
mysql_install_db
# Run mysql - you'll get a firewall alert from windows if you have it active.
mysqld_safe &
# Immediately following that, it would be wise to run the following:
mysql_secure_installation
During the mysql_install_db, I was asked who the database (DB) would be for. I specified a non-administrator account nonadmin.
For the mysql_secure_installation process, I followed the similarly named MariaDB page. In contrast to the description, I was told that I had no root password, so I set it to the same as my cygwin and windows administrator account.
I lost track of whether which account was used for each of the three commands above, but here is what I remember:
mysql_install_db: Ran as nonadmin, but prompted for admin password
mysqld_safe: Run as nonadmin
mysql_secure_installation: Attempted as nonadmin, abandoned, and
completed as administrator account admin
It seems that I should restart the server after the final step. Using ps -ef, I noted that process mysqld belongs to nonadmin. Using nonadmin, I attempted the mysqladmin shutdown command at mysql on Cygwin. I get:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'nonadmin'#'localhost' (using password: NO)'
I tried the variation of the command that prompts the user for a password: mysqladmin -p shutdown. I did this twice, entering the cygwin/windows passwords for nonadmin and admin. Both times, I get:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'nonadmin'#'localhost' (using password: YES)'
This totalled 3 attempts. I then switched to the admin account and retried all 3 attempts. I got the above messages, but with the username admin:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'admin'#'localhost' (using password: NO)'
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'admin'#'localhost' (using password: YES)'
So no joy connecting to the daemon to shut it down. As an alternative, I want to avoid clobbering mysqld with kill -9 because I like things to terminate cleanly (though I will probably do so soon).
As another alternative, I've come across references to /etc/init.d, but I have no such file.
Can anyone please explain why I can't connect to the daemon to shut it down?
Also, I'm new to MySQL, so if possible, it'd be nice to find a way back to the process at mysql on Cygwin rather than deviating from it too much.
Thanks.
What I ended up doing was kill -9 on all mysql looking processes shown by ps -ef. I then deleted /var/lib/mysql -- and accidentally deleted all of /var/lib/*. Subsequently, therefore, I reinstalled all of my Cygwin packages, thus starting from a clean slate.
I also found the following more detailed process at this alaya page for installing a MySQL/MariaDB database on Cygwin, after which I was able to shut down the MySQL server.
from the Administrator terminal run:
mysql_install_db
Start the mysql server:
mysqld_safe &
then run:
mysql_secure_installation
You should then be able to log in to MariaDB from a non-administrative shell with:
mysql -u root -p
The initial mysql_install_db step generates the following useful looking information, which I'm capturing here because I'm not sure if there is a way to get it again.
Installing MariaDB/MySQL system tables in '/var/lib/mysql' ...
2019-05-01 23:00:06 0 [Warning] InnoDB: innodb_open_files 300 should not be greaterthan the open_files_limit 256
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following commands:
'/usr/bin/mysqladmin' -u root password 'new-password'
'/usr/bin/mysqladmin' -u root -h fmaPC password 'new-password'
Alternatively you can run:
'/usr/bin/mysql_secure_installation'
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions.
You can start the MariaDB daemon with:
cd '/usr' ; /usr/bin/mysqld_safe --datadir='/var/lib/mysql'
You can test the MariaDB daemon with mysql-test-run.pl
cd '/usr/mysql-test' ; perl mysql-test-run.pl
Please report any problems at http://mariadb.org/jira
The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/
During the mysql_secure_installation step, I followed the recommendation to set a root password. Instead of the mysql -u root -p step, then, I could instead issue the following to stop the MySQL server:
mysqladmin -u root -p shutdown
I made an important discovery made about this process from the point of view of a user without administrator rights. Contrary to what is suggested on the alaya page cited above, the above process does not have to be done from an administrator account. Importantly, the user accounts with which one can connect to the MySQL server has nothing to do with the user accounts on the host system (Windows or *nix) (a fact that I got from perusing MariaDB knowledgebase). I suspect that any user on the host system can connect to any user account on the server via the socket that it presents [1], with the right password.
I also found that the above process works on a machine that has very restrictive Windows firewall policies. Even if the server (the mysqld_safe & step) and client (the mysql -u root -p step) are started from the same non-administrative account, the Windows firewall will issue a warning about curtailing some features. I suspect that the trigger is the creation of a socket for connecting to the server. Despite the warning, however, ps -ef shows the server to be running. Therefore, I suspect that the firewall restriction consists of allowing only loop-back connections. The mysql_secure_installation step apparently disallows external connections, and I found that after this step, stopping and relaunching the server no longer triggers the firewall warning. So the effect of mysql_secure_installation seems to persist into subsequent sqld launches, at least when they are started via mysqld_safe.
[1] "Present" might not be the right terminology here, as I'm more of an analyst rather than a developer or administrator.
I recently setup a DB using MariaDB and am now getting daily error messages from logrotate (see below). I am using a password for the root DB user. Per what I found online I setup the my.cnf file, but it has not changed anything. The error message states (using password: NO). Some of the posts I have seen online say "yes" instead. However, I cannot find any documentation online or in the MariaDB settings files where I can tell logrotate that it should be using a password.
Error message:
/etc/cron.daily/logrotate: mysqladmin: connect to server at 'localhost'
failed error: 'Access denied for user 'root'#'localhost' (using password: NO)'
error: error running shared postrotate script for '/var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log /var/log/mysql/mariadb-slow.log /var/log/mysql/error.log '
run-parts: /etc/cron.daily/logrotate exited with return code 1
/root/.my.cnf
[mysqladmin]
password = "password"
user = root
[mysql]
password = "password"
user = root
I am running MariaDB 10.1.37 on Debian Stretch
I suggest you provide separate user for mysqladmin and give it minimal privileges. This may cut back on the vulnerability to hackers.
mysqladmin is like mysql, it uses arguments to decide what user, what host, and whether to ask for a password:
-p -- ask for a password dynamically (hard to use in a batch script)
-pMyPwd -- provide the password (not very secure)
(neither of the above) -- no password, or...
You can use mysql_config_editor to set up a password in a special way such that you do not need to include -p.
Trying to install plesk on an ec2 (currently 3 sites running) I have. From what i've read plesk will only work on a vanilla server (hoping this is not the case).
Installation crashes on the line:
Synchronizing state of mysql.service with SysV init with /lib/systemd/systemd-
sysv-install...
Executing /lib/systemd/systemd-sysv-install enable mysql
After this the error is:
Trying to establish test connection... mysql: [Warning] World-writable config
file '/root/.my.cnf' is ignored.
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password:
NO) failed
One more attempt to connect
ERROR while trying to establish test connection. If you are installing Plesk
on an already configured MySQL server, you need to specify the administrator's
credentials to succeed with the installation. To do this, you need to create a
file - /root/.my.cnf with the 'client' section where you need to provide user
and its password ("user = $admin_name" and "password = $admin_pass"). After
installation is finished, the file /root/.my.cnf will be renamed to
/root/.my.cnf.bak
Check the error reason(see log file:
/var/log/plesk/install/plesk_17.8.11_installation.log), fix and try again
***** problem report *****
ERROR while trying to establish test connection. If you are installing Plesk on
an already configured MySQL server, you need to specify the administrator's
credentials to succeed with the installation. To do this, you need to create a
file - /root/.my.cnf with the 'client' section where you need to provide user
and its password ("user = $admin_name" and "password = $admin_pass"). After
installation is finished, the file /root/.my.cnf will be renamed to
/root/.my.cnf.bak
Check the error reason(see log file:
/var/log/plesk/install/plesk_17.8.11_installation.log), fix and try again
sh: 1: /etc/init.d/psa: not found
I have added the file /root/.my.cnf like so:
Client
User: xyz
Password: xyzxyz
But it still can't pick it up or use it (changed permissions over and over).
Has anyone been able to get past this error?
Cheers
Yes, it's possible to install Plesk on the server where mysql is already installed.
It's needed to create a file /root/.my.cnf with root access to mysql:
# cat /root/.my.cnf
[client]
user = root
password = root_password
But it's not recommended to install Plesk on the server where sites are already running because apache and nginx configuration files can be changed.
I have just installed mySQL on my Mac. The install appears to have been successful. I can successfully start and stop mySQL from the terminal command line. While in python I am attempting to create a connection and a cursor but am getting the following error message:
mysql.connector.errors.ProgrammingError: 1045 (28000): Access denied for user 'root'#'localhost' (using password: NO)
My code to get to this point is very simple:
import mysql.connector
cnx = mysql.connector.connect(user = 'root')
the import statement executes without error but the command to create the connection gives the previously stated error. I have gone through all the internet questions I could find about this topic and none of them had a solution for me. Could this be a password issue. When I installed SQL I was given a password that during the SQL install process I was told I would be prompted for but I have not been prompted for the password. I tried to include the password as part of the connection configure parameters but that just gave the following error message:
cnx = mysql.connector.connect(user = 'root', password = 'supplied_pass')
mysql.connector.errors.DatabaseError: 1862 (HY000): Your password has expired. To log in you must change it using a client that supports expired passwords.
Any help on solving this would be appreciated.
I found the solution. After the SQL install it was necessary to perform a secure installation where I reset the password and eliminated the anonymous user. The password reset and anonymous user elimination occurred by following the prompts from the secure install. The original install was in the /usr/local/mysql/ directory. So at the terminal prompt I did a change directory to the /usr/local/mysql/ directory (cd /usr/local/mysql/bin/). Once in the new directory I typed this command at the terminal prompt: sudo ./mysql_secure_installation . At that point I just followed all the prompts to change the password and eliminate the anonymous user. Once that was complete I was able to successfully create a SQL connection and cursor.
MySQL error:
Failed to Connect to MySQL at 12.34.567.890:3306 with user jsdbadmin
Lost connection to MySQL server at 'reading initial communication packet', system error: 61
Using:
Plesk, SuSE vServer, fresh installation: completly new about an half year ago.
Software:
Trying to connect via MySQL Workbench, current version.
Hostname: 12.34.567.890 (modified for privacy), also tried with domain
Port: 3306
Username: My DB user name, as specified in Plesk when DB was created.
Password: *************
Default Schema: feeds
Tried TCP/IP, TC/IP over ssh.
Searched online:
These settings are not the problem:
#skip-networking
#bind-address = 127.0.0.1
Both already commented out.
Do you have a Firewall blocking the connection ?
You can test by telneting to the mysql port.
you also need to allow the ip/user combos that are allowed to connect
e.g.
to add a new user
GRANT ALL ON jsdbadmin.* TO remoteadmuser#'12.34.567.890' IDENTIFIED BY 'PASSWORD';
or
to grant access to a specific ip
update db set Host='12.34.567.890' where Db='yourdatabase';
update user set Host='12.34.567.890' where user='jsdbadmin';
Another possible (really annoying) error is that the server's public ssh keys have changed since your last login or that you've never logged in to that server using SSH and therefore you must manually approve them.
To solve this:
$ nano ~/.ssh/known_hosts
Remove old server keys from the file. Save & exit.
Connect to the server manually (ie. from terminal) and approve saving the new keys
After successful login from terminal, retry the mysql connection over ssh.
That worked for me...