1.Install MySQL Exporter#curl -s https://api.github.com/repos/prometheus/mysqld_exporter/releases/latest | grep browser_download_url | grep linux-amd64 | cut -d '"' -f 4 | wget -qi -#tar xvf mysqld_exporter*.tar.gz#sudo mv mysqld_exporter-*.linux-amd64/mysqld_exporter /usr/local/bin/#sudo chmod +x /usr/local/bin/mysqld_exporter2.Checking version of mysql...
Showing posts with label mysql. Show all posts
Showing posts with label mysql. Show all posts
Thursday, May 23, 2024
Friday, April 1, 2022
MySQL : MySQL80 Service Started and Then Stopped on Windows Server
issue : “The MySQL80 service on Local Computer started and then stopped. Some
services stop automatically if they are not in use by other services or
programs.”solutions: my.ini config file get HEX characters added to the
beginning of the file. This causes the
MySQL service to fail when it tries to start. The solution is to remove
these HEX characters and then start the service again.1....
MySQL : Master-Slave Replication
MySQL Server (Master) IP : 192.168.0.1 MySQL Server (Slave) IP : 192.168.0.21. Install MySQL in both server2. Configure the MySQL Server (Master)#vi /etc/my.cnf.d/mysql-server.cnf- Add the following lines under the [mysqld] section.
server-id=1
log_bin=mysql-bin #sysemctl restart mysqld - Create a database USER that will be used to binf the master and slave.#mysql -u root -p mysql>...
Wednesday, October 28, 2020
MySQL : Access denied for user 'root'@'localhost
Issue:mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'root'@'localhost' (using password: YES)'Solution: 1.Edit /etc/my.cnf or /etc/mysql/my.cnf, depending on your distro.2.Add skip-grant-tables under [mysqld]3.Restart Mysql 4.You should be able to login to mysql now using the below command #mysql -u root -p5.Flush privileges. #mysql> flush privileges;6.Set...
Thursday, September 24, 2020
MySQL : Install MySQL 8.0 on CentOS 8/7
1. Adding the MySQL Yum Repository
Centos 8 - #wget https://repo.mysql.com/mysql80-community-release-el8-1.noarch.rpmCentos 7 - #wget https://repo.mysql.com/mysql80-community-release-el7-1.noarch.rpmCentos 6 - #wget https://dev.mysql.com/get/mysql80-community-release-el6-1.noarch.rpm
2. Installing Latest MySQL Version
#yum install mysql-community-server
3. Installing MySQL Release...
MySQL : Reset root password
Solution:
1.Log in to MySQL console with root user #mysql -u root -p
2.Created a new usermysql> CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';
3.Grant all privileges to the new user:mysql> GRANT ALL PRIVILEGES ON *.* To 'user'@'localhost';
4.Change the Authentication Plugin with the password: mysql> ALTER USER user IDENTIFIED WITH mysql_native_password BY 'password';
...
Wednesday, November 23, 2016
MySQL : mysql_connect(): Too many connections
Issue:
mysql_connect(): Too many connections
Solutions:
directly connect to the mySQL server (via localhost), and perform the query: SET GLOBAL max_connections = 1024; to change the connection limit at runtime (no downtime).
make your change permanent, and edit the /etc/mysql/my.cnf (or similar) and add the line max_connections = 1024; line within the [mysqld] section; then restart if you couldn't...
Thursday, April 21, 2016
MYSQL : "Host is blocked because of many connection errors"
Error : "Host is blocked because of many connection errors"
Solutions : #mysql -u root -p -e 'flush hosts'
source : http://dev.mysql.com/doc/mysql/en/blocked-host.h...
Monday, September 14, 2015
MYSQL " Table 'mysql.servers' doesn't exist at ../web-lib-funcs.pl
Problems
Table 'mysql.servers' doesn't exist at ../web-lib-funcs.pl
Solution
#mysql_upgrade -u root -p
OR
#mysql_upgrade -u root -h localhost -p --verbose --force
Then
Restart MySQL Server #/etc/init.d/mysqld
Source :
http://tonkersten.com/2012/08/126-mysql-backup-error/...
Friday, June 12, 2015
Cacti " ./syslog/syslog_incoming' is marked as crashed and should be repaired
Error:
[ERROR] /usr/libexec/mysqld: Table './syslog/syslog_incoming' is marked as crashed and should be repaired
Solution:
mysqlcheck --auto-repair --databases syslog
mysqlcheck --auto-repair --databases cacti
#mysqlcheck --auto-repair --databases syslog -u root -p
syslog.syslog
warning : 2 clients are using or haven't closed the table properly
status : OK
syslog.syslog_alert OK
syslog.syslog_incoming
warning...
Wednesday, June 4, 2014
MySQL : Cannot load from mysql.proc. The table is probably corrupted
Error : Cannot load from mysql.proc. The table is probably corruptedSolution :#mysql_upgrade -pSource : http://www.robsearles.com/2011/02/fix-cannot-load-from-mysql-proc-the-table-is-probably-corrupted/ http://www.myguysolutions.com/2013/10/30/how-to-resolve-mysql-error-code-1548-cannot-load-from-mysql-proc-the-table-is-probably-corrupt...
Friday, April 25, 2014
MySQL error : Another MySQL daemon already running with same Unix socket
1. Stop mysql service #service mysqld stop2. Movemv /var/lib/mysql/mysql.sock /var/lib/mysql/mysql.sock.bak3. Start mysql service#service mysqld startSource : http://www.technouz.com/1951/fix-error-linux-another-mysql-daemon-already-running-with-the-same-unix-sock...
Sunday, November 24, 2013
MySQL: Repair table database of Nagios
Problems
nagios error : ./nagios/nagios_servicechecks' is marked as crashed and should be repaired
Solutions:
#mysqlcheck -p --auto-repair nagios nagios_hoststatus;
Enter password:
nagios.nagios_hoststatus
warning : Table is marked as crashed
warning : 3 clients are using or haven't closed the table properly
error : Found 8 keys of 9
error : Corrupt
Repairing tables
nagios.nagios_hoststatus
warning...
Thursday, November 29, 2012
MYSQL : /usr/libexec/mysqld: Can’t create/write to file ‘/tmp/’ (Errcode: 13)
Problems :121129 10:15:13 InnoDB: Using Linux native AIO/usr/libexec/mysqld: Can't create/write to file '/tmp/ibTB92a6' (Errcode: 13)121129 10:15:13 InnoDB: Error: unable to create temporary file; errno: 13121129 10:15:13 [ERROR] Plugin 'InnoDB' init function returned error.121129 10:15:13 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.121129 10:15:13 [ERROR] Unknown/unsupported storage...
Saturday, March 5, 2011
MySQL : Remote Error
Resolved:# edit /my.iniAdd:[mysqld]skip-name-resolveORDisable:# bind-address = 127.0.0.1 User Privilege:add...
Wednesday, January 26, 2011
Quick PHP code
Quick PHP code to test ldap connection$ldap = ldap_connect(“domain.com”);$username=”username@domain.com”;$password=”password”;if($bind = ldap_bind($ldap, $username,$password ))echo “logged in”;elseecho “fail”;echo “done”;?>Quick PHP code to test mysql database connectionecho “trying”;$link = mysql_connect(’123.123.123.123′, ‘username’, ‘password’);if (!$link) {die(‘Could not connect: ‘ . mysql_error());}else{echo...
Subscribe to:
Posts (Atom)