[HOW TO] 'Access denied for user 'debian-sys-maint'@'localhost'

~$ sudo /etc/init.d/mysql restart
* Stopping MySQL database server mysqld [fail]
* Starting MySQL database server mysqld [ OK ]
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'

what is this “debian-sys-maint” user? 
this MySQL user is created for the Ubuntu to be able to start/stop the database and to carry out other maintenance operations.

Sounds well enough, but then why do I keep running into the “access denied” problem for this user? Well, the issue is that with each update to MySQL, the user’s password in the database is overwritten. Ubuntu seems to go to the file/etc/mysql/debian.cnf in order to find this user’s password, but obviously the password is out of sync after the update has been applied.

Ok, now you must know the version of mysql. (e.g. dpkg list | grep mysql ; it will show you the version)

sudo dpkg-reconfigure mysql-server-5.1

Here you set the new password of root. This action also sync to /etc/mysql/debian.cnf. Thus you will have not see above issues.


Thank you for reading this article, please a comment if you are interested.

Tiến Phan - R0039

Knowledge is Endless

Sharing for Success

[HOW TO} Fix ERROR 2013 (HY000): Lost connection to MySQL server during query

Hello dude,

In this article, I show you how to resolve with mysql in case below:
1. When I create a user in mysql:
mysql> CREATE USER 'teppi'@'localhost' IDENTIFIED BY 'gogoale'; 
ERROR 2013 (HY000): Lost connection to MySQL server during query
Googled, I know the solution for this. From of my point, it seems to be that mysql is having with mysql storage, it can not get the truly table in mysql. I will use "mysql_upgrade" to fix:

root@teppi:~# mysql_upgrade -u root -p
Enter password: 
Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
This installation of MySQL is already upgraded to 5.6.19, use --force if you still need to run mysql_upgrade

Oh what the fuck? keep calm down :) please see: This installation of MySQL is already upgraded to 5.6.19. It means your mysql is already upgraded and you could not upgrade. Ok, I am needing to fix this issues. Thus I use "--force"

root@teppi:~# mysql_upgrade --force -u root -pEnter password: Looking for 'mysql' as: mysqlLooking for 'mysqlcheck' as: mysqlcheckRunning 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/var/run/mysqld/mysqld.sock' Warning: Using a password on the command line interface can be insecure.Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/var/run/mysqld/mysqld.sock' Warning: Using a password on the command line interface can be insecure.mysql.columns_priv OKmysql.db OKmysql.event OKmysql.func OKmysql.general_log OKmysql.help_category OKmysql.help_keyword OKmysql.help_relation OKmysql.help_topic OKmysql.host OKmysql.innodb_index_stats OKmysql.innodb_table_stats OKmysql.ndb_binlog_index OKmysql.plugin OKmysql.proc OKmysql.procs_priv OKmysql.proxies_priv OKmysql.servers OKmysql.slave_master_info OKmysql.slave_relay_log_info OKmysql.slave_worker_info OKmysql.slow_log OKmysql.tables_priv OKmysql.time_zone OKmysql.time_zone_leap_second OKmysql.time_zone_name OKmysql.time_zone_transition OKmysql.time_zone_transition_type OKmysql.user OKRunning 'mysql_fix_privilege_tables'...Warning: Using a password on the command line interface can be insecure.Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/var/run/mysqld/mysqld.sock' Warning: Using a password on the command line interface can be insecure.Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/var/run/mysqld/mysqld.sock' Warning: Using a password on the command line interface can be insecure....percona.checksums OKOK
root@teppi:~# /etc/init.d/mysql status * /usr/bin/mysqladmin Ver 8.42 Distrib 5.6.19, for debian-linux-gnu on x86_64Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners. Server version 5.6.19-0ubuntu0.14.04.1Protocol version 10Connection Localhost via UNIX socketUNIX socket /var/run/mysqld/mysqld.sockUptime: 17 sec Threads: 1 Questions: 396 Slow queries: 0 Opens: 1685 Flush tables: 1 Open tables: 376 Queries per second avg: 23.294
After upgraded, you can get the issues as below:

root@teppi:~# mysql -u root -pEnter password: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)root@teppi:~# /etc/init.d/mysql status * MySQL is stopped.root@teppi:~# /etc/init.d/mysql start * Starting MySQL database server mysqld No directory, logging in with HOME=/
Ok, do not worry.
root@teppi:~# ps -ef | grep mysqlmysql 29045 1 0 13:41 ? 00:00:00 /usr/sbin/mysqldmysql 31092 1 0 13:44 ? 00:00:00 /bin/sh /usr/bin/mysqld_safemysql 31523 31092 0 13:44 ? 00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --log-error=/var/log/mysql/error.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock --port=3306root 32211 27210 0 13:45 pts/5 00:00:00 grep --color=auto mysqlroot@teppi:~# kill -9 31092 31523 29045
Ok, now you can login mysql with the new user:

root@teppi:~# mysql -u teppi -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 137
Server version: 5.6.19-0ubuntu0.14.04.1 (Ubuntu)
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;

Thank you for reading this article, please a comment if you are interested.

Tiến Phan - R0039

Knowledge is Endless

Sharing for Success

[HOW TO] Public key for google-chrome-stable-43.0.2357.132-1.x86_64.rpm is not installed



I'm using Fedora 22, today fedora give me the alert about new update officially. Then I run the command:

[tien@localhost ~]$ sudo dnf -y --exclude=kernel\* update (update exclude kernel)







But it can not complete:

warning: /var/cache/dnf/x86_64/22/google-chrome/packages/google-chrome-stable-43.0.2357.132-1.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 7fac5991: NOKEY Error: Public key for google-chrome-stable-43.0.2357.132-1.x86_64.rpm is not installed

It seems to be that it did not trusted. You need to add the GPG key google chrome to local. Do it as below:

On an RPM-based system (Fedora, SUSE, Mandriva, RHEL, etc.), download the key and then use rpm to install it. 

wget https://dl.google.com/linux/linux_signing_key.pub
sudo rpm --import linux_signing_key.pub


You can verify the key installation by running: 

rpm -qi gpg-pubkey-7fac5991-*

To manually verify an RPM package, you can run the command: 

rpm --checksig -v packagename.rpm

This article, I reference here: https://www.google.com/linuxrepositories/


Thank you for reading this article, please a comment if you are interested.

Tiến Phan - R0039

Knowledge is Endless

Sharing for Success

[HOW TO] rpm auto install dependencies

Hello,

I have troubled with rpm. I must be installed once rpm but it can not get the dependencies.
How to resolve?

Googled, I found the solution:

1. Create a directory for your local repository e.g. /home/user/repo
2. move the rpm package to that directory
3. grant the permission for /home/user/repo
  #chmod -R root:root /home/user/repo
4. Install createrepo package and run the command:
  #createrepo /home/user/repo
5. Create a repository configuration
  #vi /etc/yum.repos.d/myrepo.repo
  #
  [local]
  name=My Awesome Repo
  baseurl=file:///home/user/repo
  enabled=1
  gpgcheck=0
6. Install package normally


Thank you for reading this article, please a comment if you are interested.

Tiến Phan - R0039

Knowledge is Endless

Sharing for Success