Informations
Jump to content

Lorem Ipsum...

Click to Dismiss this Notification
Ładowanie danych...

Recommended Posts

This warning appears only in MySQL versions 5.6 and 5.7. If you are using an earlier version, feel free to disregard this guide.

Warning Message in Shell & MySQL Logs

You may encounter a notification that states: "Using a password on the command line interface can be insecure."

Many users rely on the mysql_query (standard) function found in questlib.lua, which often triggers this warning.

Steps to Fix the Warning

  1. For MySQL Users
    If you are using a specific MySQL user, modify “YOURUSERNAME” in the command below and execute it:

     
  • This is the hidden content, please

     

  • For the Root MySQL User
    If you are using the root account, the command will be:

     
  1. mysql_config_editor set --login-path=local --host=localhost --user=root --password
        

    Enter your password when prompted.

After executing this, you’ll create a new encrypted file named .mylogin.cnf.

You can find this file located at:

  • For standard users: /home/YOURUSERNAME/.mylogin.cnf
  • For root: /root/.mylogin.cnf

This file is encrypted, but you can check its contents (with the password hidden by asterisks) using:

 
This is the hidden content, please

To access MySQL, simply use the following command:

 
This is the hidden content, please

Updating questlib.lua

Now, let’s modify questlib.lua by removing the existing mysql_query function and replacing it with the updated version. This adjustment eliminates the need to read the credentials from the CONFIG file (username/password).

Here’s the updated mysql_query function:

 
This is the hidden content, please

Conclusion

That’s it! You should now be able to operate MySQL without encountering the insecure password warning. Enjoy your day!

Link to comment
Share on other sites


Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

spacer.png

Disable AdBlock
The popup will be closed in 5 seconds...