MilesWeb
MilesWeb Hosting Forum

Please login or register.

Login with username, password and session length

 

News:

SMF - Just Installed!


Author Topic: How to access MySQL without password from command line?  (Read 3929 times)

0 Members and 1 Guest are viewing this topic.

Offline Dipak Bhoi

  • MilesWeb Team Member
  • Full Member
  • ***
  • Posts: 208
  • Karma: +5/-0
    • View Profile
    • MilesWeb Internet Services
How to access MySQL without password from command line?
« on: May 01, 2015, 07:43:35 PM »
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.

Quote
skip-grant-tables

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

Hope this post will like you..

Enjoy !! :) :)
 
MilesWeb.com
cPanel Hosting in India - cPanel Hosting in India.

Grab an SSL for your website and SAVE 20% now. Coupon Code SSLSAVE20.

MilesWeb Hosting Forum

How to access MySQL without password from command line?
« on: May 01, 2015, 07:43:35 PM »