How to access MySQL without password from command line?

Started by Dipak Bhoi, May 01, 2015, 07:43:35 PM

Previous topic - Next topic

Dipak Bhoi

Hello folks,

Here are tricks to access MySQL as root without password.

Trick 1 : Create a file .my.cnf under /root directory and add the credentials there as below.

Quote[client]
user=root
password="password"


Trick 2 : Open a mysql configuration file /etc/my.cnf and add below line in it.

Quoteskip-grant-tables

Save the file and restart the mysql service.
Quote
#/etc/init.d/mysql restart

Hope this post will like you..

Enjoy !! :) :)
MilesWeb - 30-Day Money Back
cPanel Web Hosting - cPanel Hosting in India
Grab a Free SSL for your website.  WordPress Optimized Solution.