Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Mysql Access denied for user 'root'@'localhost'

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
User avatar
philo_neo
Posts: 77
Joined: 2010-06-18 16:48

Mysql Access denied for user 'root'@'localhost'

#1 Post by philo_neo »

Hello,
I went to configure my MySQL server on Debian 8.8.
when I make a

Code: Select all

 mysql -u root -p,
it returns to me a password request that

Code: Select all

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
I lost, how to reset the password of root on localhost?

dcihon
Posts: 279
Joined: 2012-09-23 16:18
Been thanked: 3 times

Re: Mysql Access denied for user 'root'@'localhost'

#2 Post by dcihon »

Google search came up with this:
https://stackoverflow.com/questions/416 ... tlocalhost

You probably need to do some reading on mysql.

User avatar
philo_neo
Posts: 77
Joined: 2010-06-18 16:48

Re: Mysql Access denied for user 'root'@'localhost'

#3 Post by philo_neo »

when i put this command

Code: Select all

 /etc/my.cnf
Add skip-grant-tables under [mysqld]
i have this error

Code: Select all

mysql -u root -p
mysql: [ERROR] Found option without preceding group in config file /etc/my.cnf at line 1!
mysql: [ERROR] Fatal error in defaults handling. Program aborted!
root@dct-tousin:/var/lib/mysql# /etc/init.d/mysql stop
[ ok ] Stopping mysql (via systemctl): mysql.service.
when i delete

Code: Select all

/etc/my.cnf
Add skip-grant-tables 
the server start normaly !

PS I have already done some research on google

dcihon
Posts: 279
Joined: 2012-09-23 16:18
Been thanked: 3 times

Re: Mysql Access denied for user 'root'@'localhost'

#4 Post by dcihon »

I am not an expert at this but post the contents of my.cnf first to see if someone here with mysql can spot something that might be out of place.

steve_v
df -h | grep > 20TiB
df -h | grep > 20TiB
Posts: 1400
Joined: 2012-10-06 05:31
Location: /dev/chair
Has thanked: 79 times
Been thanked: 175 times

Re: Mysql Access denied for user 'root'@'localhost'

#5 Post by steve_v »

philo_neo wrote: when i delete

Code: Select all

/etc/my.cnf
Add skip-grant-tables 
the server start normaly !
No crap, your config syntax is FUBAR.
Don't just paste the whole lot into the file, that was an instruction to add the key 'skip-grant-tables' to the appropriate section in my.cnf. The error indicates that it is not.
Go read the manual.
Once is happenstance. Twice is coincidence. Three times is enemy action. Four times is Official GNOME Policy.

Post Reply