Skip to main content

MariaDB / MySQL - Access denied for user 'root'@'localhost'

I am using MariaDB for one of the project and today I encountered some weird issue while connecting from command line. For those who are not familiar with MariaDB - it is basically open source version of MySQL. Click here to get more information about MariaDB. Also, click here to read various MariaDB articles, basic commands, etc. You can access various training tutorials here.

Alright, so I was trying to login to MariaDB from my Ubuntu Command Prompt but I was constantly getting error: Access denied for user 'root'@'localhost'


I was going in various directions, but the solution to this problem was very very simple. I just had to run the login command with sudo, can you believe it? If prompted, you will have to type sudo password.


Just so you know, default password for MariaDB root user is <nopassword>, that's right, it does not have any password.

P.S. Click here to access my other posts.

Comments

  1. Hello Sagar,


    I love all the posts, I really enjoyed.
    I would like more information about this, because it is very nice., Thanks for sharing.


    I wrote about Kerberos support in MuleSoft, so it seems only natural to discuss the other place where Kerberos fits into the API ecosystem. Not only can Kerberos be used to secure APIs hosted or proxied by MuleSoft, but certain third-party systems can use or even require Kerberos for their security


    By the way do you have any YouTube videos, would love to watch it. I would like to connect you on LinkedIn, great to have experts like you in my connection (In case, if you don’t have any issues).
    Please keep providing such valuable information.


    Merci Beaucoup,
    Abhiram

    ReplyDelete
  2. Hi Mate,

    Gasping at your brilliance! Thanks a tonne for sharing all that content. Can’t stop reading. Honestly!

    Software is losing its magic. We simply demand too much from the current approaches. As a result, software developers are losing the battle with complexity, often without realizing it. More often than not, little failures pile on top of other little failures, and life for the consumer, as well as the business, becomes more frustrating rather than easier.
    I started using Mulesoft tutorial blog for my training practice.

    Excellent tutorials - very easy to understand with all the details. I hope you will continue to provide more such tutorials.

    Obrigado,
    Morgan

    ReplyDelete
  3. MySQL Access Denied for User" is error, which can be solved. It arises from insufficient privileges. Double-checking username, password, and database permissions is required. Lawn Darts Play This blog is helpful.

    ReplyDelete

Post a Comment

Popular posts from this blog

Postman - Set Timeout / Think Time / Pause / Delay

Those who are involved in API or web service development should be knowing about Postman , it is one of the most popular tools to build API requests and test them. Collection Runner is one of the feature of Postman . You can create one or more requests and group them in Collection, and as name suggests, you can run the entire collection i.e. series or requests. What if you need to add "Think Time" or "Delay" or "Pause" between two requests? It is surely possible, here are some options: Using Collection Runner GUI This option will be applicable to all the requests in the collection In the Collection Runner window, enter value for Delay in milliseconds Using Command Line This option will be applicable to all the requests in the collection Newman is a comman line collection runner for Postman Command To Execute: newman run <collection-file-source> --delay-request [number] Click here to get the details about Newman Newman installation

How to Extract Values from Response Header in JMeter?

JMeter is a powerful tool for API testing. Let's say you are are writing test cases for one of your RESTful service; and you want to extract and validate the value returned as part of response header. It is little bit tricky to extract the value from Response Header in JMeter , but it is possible. For example, your RESTful service returns "ETag" in response header. When you look at the raw response data, the value is displayed something like this: ETag: 2666d92fa9ebf10250acdb235546f045 To exact value of this reaponse header in JMeter: Right click on your HTTP request, then add Post Processor element - Regular Expression Extractor Select Radio button - Main sample only Select Radio burron - Response Headers Type some name in Reference Name section - for example, eTagVariable Type this expression in Reference Expression section - ETag:\s+(.+) IMPORTANT: This expression will select pick the ETag response header parameter and select everything after colon bla

Setup OpenLDAP on MAC

macOS (Mac OS X or OS X) is the current series of Unix-based graphical operating systems developed and marketed by Apple Inc . designed to run on Apple's Macintosh computers ("Macs"). Within the market of desktop, laptop and home computers, and by web usage, it is the second most widely used desktop OS after Microsoft Windows . Recently, while working on one of my projects, there was a requiremnt to integrate our system with LDAP i.e. Lightweight Directory Access Protocol ( LDAP ). So, I wanted to try out some samples by installing OpenLDAP on my MAC. Initially, it looked streightforward but later I realized that there are multiple steps involved to get OpenLDAP up and running in my Mac. So, I thought of documenting various steps so that others can refer them. What do you need to begin? MAC Obviously you need MAC because these steps will work only for MAC (Sorry Windows users) Homebrew This is a package manager for macOS. Click here and follow the instructio

MuleSoft - Static IP Addresses and Multiple Workers

Did you just realize that your Mule Application requires horizontal scalling ? Well, thats easy - just go to CloudHub Runtime Manager, select your application and change the "Workers" count from 1 to either 2, 3 or 4. If numbers are grayed out, then you might have to adjust the "Worker Size", or purchase additional capacity from MuleSoft. So, what is the issue then? At the time of the blog post, based on Mule documentation, if you are using only 1 worker and if you want to apply static IP, then you can simply navigate to "Static IPs" section in Runtime Manager and allocate the static IP address. The issue is when you want to apply Static IP addresses for more than 1 workers for various reasons including IP whitelisting. Based on Mule documentation you cannot apply static IPs if you are using more than 1 worker. From Mule Documentation: "Static IPs are not supported for private IP addresses inside a CloudHub VPC and it is only supported for app

Sublime Text 3 - Pertty Format JSON

You must be looking for some easy options to pretty format JSON data. Well, there are many websites which provides this capability and you can pretty format JSON data in browser. I use Sublime Text 3 text editor, and I was trying to see if I can pretty format JSON within the text editor itself. You can follow these simple steps: Open Sublime Text 3 text editor If you are using MAC OS Press Command + Shift + P Then select "Install Package" Search for "Pretty JSON" Install If you are using Windows OS Press CTRL + Shift + P Then select "Install Package" Search for "Pretty JSON" Install Once the installation is complete, select JSON string If you are using MAC OS Press Command + Control + J If you are using Windows OS Press CTRL + ALT + J Thats it! Now you don't have to copy your JSON string from Sublime Text 3, paste in your browser, format it, then copy formatted JSON from browser and paste it back in your Sublime

Postman - Storing and Retrieving Numeric Values from Environment Variables

If you are using Postman for your API testing and if you want to store and retrieve numeric values from environment variables, then here is a simple trick - use "Number" function. Let me explain the problem and solution. Problem: I want to store numeric value in environment variable, for example - response time, then I want to retrieve the value from this environment variable and use for comparison. Solution: To store response time in environment variable, use setEnvironmentVariable function To retrieve the value from environment variable, use postman.<variable_name> To convert variable value to number for comparison, use Number() function   P.S. Click here to access my other posts.

Access GitHub Repositories with SourceTree and 2FA (2 Factor Authentication)

Many developers and organizations use GitHub as code repository. Similarly, many prefer to commit code in GitHub repositories using various commands. I personally think that using any kind of user interface for committing code and performing various GIT operations is much more simpler and productive. SourceTree is one such Atlassian product. SourceTree is a free Git client and provides beautiful GUI that offers a visual representation for various Git repositories. For added security, you can enable 2FA (i.e. 2 Factor Authentication) for your GitHub account. Configuring GitHub with SourceTree is very very simple. Here are the steps on MAC OS (steps on Windows OS are similar): If you have not enabled 2FA: Open SourceTree and go to Preferences Select Accounts Click on Add button to add account On the pop-up window, select Host as "GitHub" Select Auth Type as "Basic" Type your GitHub username (not email) Type your password Select Protocol as HTTPS

MuleSoft LDAP Connector With Example

As we all know, the L ightweight D irectory A ccess Protocol ( LDAP ) is an open, vendor-neutral, industry standard application protocol for accessing and maintaining distributed directory information services over an Internet Protocol (IP) network. A common use of LDAP is to provide a central place to store usernames and passwords. This allows many different applications and services to connect to the LDAP server to validate users. This has a major benefit that allows a central place to update and change user passwords. With MuleSoft’s LDAP Connector , we can access and maintain directory information services over an IP network by connecting to any LDAP server. LDAP Connector is developed by MuleSoft's developer community and it is categorized as Community Connectors. Latest LDAP Connector documentation is available here . Unfortunately, the information and examples of this connector are limited and scattered all over the web. Today, I am trying to cover as many details as p

Run JMeter Tests with Maven

In this article, I will be focusing on configuring JMeter with Maven but lets first understand some basics of JMeter and Maven. The Apache JMeter™ application is open source software, a 100% pure Java application designed to load test functional behavior and measure performance. These days, performance testing is very very important especially when the applications are targeting large number of users. There are many tools available in market, some are paid, some are free. Apache JMeter is one such free and open source software. Though JMeter's was initially developed for load testing web applications, it is now far more advanced. The biggest advantage of the JMeter is that it can do many things like performance and functional testing for web services, databases, FTPs or Web Servers, LDAP, JMS, trigger emails/notifications. Most of these features are implemented with plugins. JMeter is powerful, easy to install and use and FREE! It is a Java desktop application with simple us

Password Protect Excel Sheet

We all use excel sheets for some or the other purpose and many times we also want to protet them to restrict unauthorized access. Here are the simple steps to protect excel sheets (latest excel version): Open the excel sheet. From top menu, click on "File". Then select "Passwords..." Enter "Password to open". Enter "Password to modify". Next, you will be asked to "Reenter password to proceed". Same as Step 4. Next, you will be asked to "Reenter password to modify". Same as Step 5. Save and close the file. That's it. Next time when you open the file, you will be prompted to enter the password.   P.S. Click here to access my other posts.